Characters (multi-byte) in printjoin ignored in context index

Hi everybody,
I have one problem with a challenging text search in our company. The paragraph-sign should be found in multiple searches so we need to index tokens containing it.
To make clear what I found out so far I constructed a test case. Seems to be important that the database character set is AL32UTF8 (edit: Database Version is 11.2.0.3).
So at first I built a test-table and filled it with some rows:
CREATE TABLE test_tab (test_col VARCHAR2 (30));
INSERT ALL
  INTO test_tab VALUES ('print§join')
  INTO test_tab VALUES ('print#join')
  INTO test_tab VALUES ('print*join')
  INTO test_tab VALUES ('print\join')
  INTO test_tab VALUES ('print-join')
  INTO test_tab VALUES ('print_join')
  INTO test_tab VALUES ('print~join')
  INTO test_tab VALUES ('print;join')
  INTO test_tab VALUES ('print:join')
  INTO test_tab VALUES ('print,join')
  INTO test_tab VALUES ('print.join')
  INTO test_tab VALUES ('print/join')
  INTO test_tab VALUES ('print+join')
SELECT * FROM DUAL;
After that I created index preferences and built an index:
BEGIN
  ctx_ddl.create_preference(
    preference_name => 'auf_auftrag_lexer'
   ,object_name     => 'BASIC_LEXER'
  ctx_ddl.set_attribute(
    preference_name => 'auf_auftrag_lexer'
   ,attribute_name  => 'printjoins'
   ,attribute_value => '§-./+~#_\,;:*'
  ctx_ddl.set_attribute(
    preference_name => 'auf_auftrag_lexer'
   ,attribute_name  => 'punctuations'
   ,attribute_value => '!:.;,?'
  ctx_ddl.set_attribute(
    preference_name => 'auf_auftrag_lexer'
   ,attribute_name  => 'numjoin'
   ,attribute_value => ','
  ctx_ddl.set_attribute('auf_auftrag_lexer'
   ,attribute_name  => 'alternate_spelling'
   ,attribute_value => 'german'
END;
CREATE INDEX i_test_tab_ctx ON test_tab(test_col)
  INDEXTYPE IS ctxsys.CONTEXT PARAMETERS ('LEXER auf_auftrag_lexer
                                          WORDLIST auft_fuzzy_pref
                                          STOPLIST ctxsys.empty_stoplist
                                          SYNC (EVERY "SYSDATE+1/24/30")');
So printjoins contains all the special characters used in the rows of the table.
But when we examine the results of the indexed tokens:
SELECT token_text FROM dr$i_test_tab_ctx$i;
TOKEN_TEXT
JOIN
PRINT
PRINT#JOIN
PRINT*JOIN
PRINT+JOIN
PRINT,JOIN
PRINT-JOIN
PRINT.JOIN
PRINT/JOIN
PRINT:JOIN
PRINT;JOIN
PRINT\JOIN
PRINT_JOIN
PRINT~JOIN
14 rows selected
All rows are indexed correctly cos all the special characters are defined as printjoins. One row is missing - the row containing the paragraph sign is splitted in two tokens ("JOIN" and "PRINT"). The paragraph sign is treated as not existent in the printjoins attribute value (but it is defined with the correct codepoint in the ctx-View).
The paragraph sign differs from the other special characters so far, that it is stored as a multi(2-)-byte-character in the db. Content of the test_tab table:
DUMP(TEST_COL)
Typ=1 Len=11: 112,114,105,110,116,194,167,106,111,105,110 §-Sign
Typ=1 Len=10: 112,114,105,110,116,35,106,111,105,110
Typ=1 Len=10: 112,114,105,110,116,42,106,111,105,110
Typ=1 Len=10: 112,114,105,110,116,92,106,111,105,110
Typ=1 Len=10: 112,114,105,110,116,45,106,111,105,110
Typ=1 Len=10: 112,114,105,110,116,95,106,111,105,110
Typ=1 Len=10: 112,114,105,110,116,126,106,111,105,110
Typ=1 Len=10: 112,114,105,110,116,59,106,111,105,110
Typ=1 Len=10: 112,114,105,110,116,58,106,111,105,110
Typ=1 Len=10: 112,114,105,110,116,44,106,111,105,110
Typ=1 Len=10: 112,114,105,110,116,46,106,111,105,110
Typ=1 Len=10: 112,114,105,110,116,47,106,111,105,110
Typ=1 Len=10: 112,114,105,110,116,43,106,111,105,110
13 rows selected
So I suspect the multy-byte character set as a cause of the problem. But documentation says BASIC_LEXER supports the character set. I can't determine whether the problem has to do with storing the index preferences or appears while indexing the data.
Seems to be a non-common problem - ideas anybody
Thx in Advance
Stephan
Edit:
Missed one thing - the mentioned auft_fuzzy_pref for index creation is just set for configure the index as a substring index:
EXEC ctx_ddl.create_preference('AUFT_FUZZY_PREF', 'BASIC_WORDLIST');
EXEC ctx_ddl.set_attribute('AUFT_FUZZY_PREF','SUBSTRING_INDEX','TRUE');

Hi Teresa,
You can test to send the XML-Mesage in "ISO-8859-1" encoding.
You Chance the encoding on XML Header:
<?xml version="1.0" encoding="ISO-8859-1"?>
maybe this works.
Regards,
Robin

Similar Messages

  • Handling Multi-byte/Unicode (Japanese) characters in Oracle Database

    Hello,
    How do I handle the Japanase characters with Oracle database?
    I have a Java application which retrieves some values from the database; makes some changes to these [ex: change value of status column, add comments to Varchar2 column, etc] and then performs an UPDATE back to the database.
    Everything works fine for the English. But NOT for Japanese language, which uses Multi-byte/Unicode characters. The Japanese characters are garbled after the performing the database UPDATE.
    I verified that Java by default uses UTF16 encoding. So there shouldn't be any problem with Java/JDBC.
    What do I need to change at #1- Oracle (Database) side or #2- at the OS (Linux) side?
    /* I tried changing the NLS_LANG value from OS and NLS_SESSION_PARAMETERS settings in Database and tried 'test' insert from SQL*plus. But SQL*Plus converts all Japanese characters to a question mark (?). So could not test it via SQL*plus on my XP (English) edition.
    Any help will be really appreciated.
    Thanks

    Hello Sergiusz,
    Here are the values before & after Update:
    --BEFORE update:
    select tar_sid, DUMP(col_name, 1016) from table_name where tar_sid in ('6997593.880');
    /* Output copied from SQL-Developer: */
    6997593.88 Typ=1 Len=144 CharacterSet=UTF8: 54,45,53,54,5f,41,42,53,54,52,41,43,54,e3,81,ab,e3,81,a6,4f,52,41,2d,30,31,34,32,32,e7,99,ba,e7,94,9f,29,a,4d,65,74,61,6c,69,6e,6b,20,e3,81,a7,e7,a2,ba,e8,aa,8d,e3,81,84,e3,81,9f,e3,81,97,e3,81,be,e3,81,97,e3,81,9f,e3,81,8c,e3,80,81,52,31,30,2e,32,2e,30,2e,34,20,a,e3,81,a7,e3,81,af,e4,bf,ae,e6,ad,a3,e6,b8,88,e3,81,bf,e3,81,ae,e4,ba,8b,e4,be,8b,e3,81,97,e3,81,8b,e7,a2,ba,e8,aa,8d,e3,81,a7,e3,81,8d,e3,81,be,e3,81,9b,e3,82,93,2a
    --AFTER Update:
    select tar_sid, DUMP(col_name, 1016) from table_name where tar_sid in ('6997593.880');
    /* Output copied from SQL-Developer: */
    6997593.88 Typ=1 Len=144 CharacterSet=UTF8: 54,45,53,54,5f,41,42,53,54,52,41,43,54,e3,81,ab,e3,81,a6,4f,52,41,2d,30,31,34,32,32,e7,99,ba,e7,94,9f,29,a,4d,45,54,41,4c,49,4e,4b,20,e3,81,a7,e7,a2,ba,e8,aa,8d,e3,81,84,e3,81,9f,e3,81,97,e3,81,be,e3,81,97,e3,81,9f,e3,81,8c,e3,80,81,52,31,30,2e,32,2e,30,2e,34,20,a,e3,81,a7,e3,81,af,e4,bf,ae,e6,ad,a3,e6,b8,88,e3,81,bf,e3,81,ae,e4,ba,8b,e4,be,8b,e3,81,97,e3,81,8b,e7,a2,ba,e8,aa,8d,e3,81,a7,e3,81,8d,e3,81,be,e3,81,9b,e3,82,93,2a
    So the values BEFORE & AFTER Update are the same!
    The problem is that sometimes, the Japanese data in VARCHAR2 (abstract) column gets corrupted. What could be the problem here? Any clues?

  • Store Multi Byte Characters in WE8ISO8859P1 Database without Migration

    Hi - I am looking for a solution where I can store the Multi Byte Character's under the WE8ISO8859P1 Database.
    Below are the DB NLS_PARAMETERS
    NLS_CHARACTERSET = WE8ISO8859P1
    NLS_NCHAR_CHARACTERSET = AL32UTF8
    NLS_LENGTH_SEMANTICS = BYTE
    Size of DB = 2 TB.
    DB Version = 11.2.0.4
    Currently there is a need to store the Chinese Characters under NAME and ADDRESS Columns only. Below are the description of the columns.
    Column Name            DataType
    GIVEN_NAME_ONE
    VARCHAR2(120 BYTE)
    GIVEN_NAME_TWO
    VARCHAR2(120 BYTE)
    LAST_NAME
    VARCHAR2(120 BYTE)
    ADDR_LINE_ONE
    VARCHAR2(100 BYTE)
    ADDR_LINE_TWO
    VARCHAR2(100 BYTE)
    ADDR_LINE_THREE
    VARCHAR2(100 BYTE)
    What are my option's over here without considering the Migration WE8ISO8859P1  DB to AL32UTF8 ?
    1. Can I increase the size of the Column i.e make it n x 4. e.g NAME will be 480 Byte  and ADDRESS will be 400 Byte.? What are pros and cons ?
    2. Convert the existing Column from VARCHAR2 to NVARCHAR2 with the Same Size ? i.e NVARCHAR2(120 BYTE) ?
    3. Add the extension to an table with new columns - NVARCHAR2. e.g NAME - NVARCHAR2(120 CHAR) and ADDRESS (100 - CHAR) ?
    4. Database got Clobs,Blobs, Long etc. got Varied Data, Is it a good idea to Migrate to AL32UTF8  with Minimal Downtime ?
    Please suggest the best alternatives. Thanks.
    Thanks
    Jitesh

    Hi Jitesh,
    NLS_NCHAR_CHARACTERSET can either be AL16UTF16 or UTF8. So mostly your DB would have UTF8.
    You can definitely insert Unicode characters into N-type columns. Size of the N-type column will depend on the characters you plan to store in them.
    If you use N-types, do make sure you use the (N'...') syntax when coding it so that Literals are denoted as being in the national character set by prepending letter 'N'.
    Although you can use them, N-types are  not very well supported in 3the party client/programming environments, you may need to adapt a lot of code to use N-types properly and there are some limitations.
    While at first using N-types for a (few) columns seems like a good idea to avoid the conversion of a whole database , in many cases the end conclusion is that changing the NLS_CHARACTERSET is simply the easiest and fastest way to support more languages in an Oracle database.
    So, It depends on how much of your data will be unicode which you would store in N-type characters.
    If you do have access to My Oracle Support you can check Note 276914.1 :The National Character Set ( NLS_NCHAR_CHARACTERSET ) in Oracle 9i, 10g , 11g and 12c, For more details.
    With respect to your Downtime, The actual conversion (CSALTER or in case using DMU) shouldn't take too much time, if you have run CSSCAN on your DB and made sure you have taken care of all your truncation, convertible and lossy data (if any).
    It would be best for you to run CSSCAN initially to gauge how much convertible/lossy/truncation data you need to take care.
    $ CSSCAN FROMCHAR=WE8ISO8859P1 TOCHAR=AL32UTF8 LOG=P1TOAl32UTF8 ARRAY=1000000 PROCESS=2 CAPTURE=Y FULL=Y
    Regards,
    Suntrupth

  • Multi-byte characters are garbled in SQL Server Business Intelligent Development Studio (Visual Studio) 2008

    Hi,
    I'm revising an existing report which was developed by my predecessor. Though it works fine in the production environment, when I open the .rdl file with SQL Server Business Intelligent Studio (Visual Studio) 2008 on my client
    PC, I find all the multi-byte characters are garbled. When I open it with the BIDS (the same version) on the server, it shows everything correctly.
    The fonts for the controls (labels) are Tahoma and it's originally only for alphabets, but multi-byte characters are supposed to be displayed in MSGOTHIC by Font Link as they are displayed correctly on the server.
    Could anyone advise me how to solve this issue? I know I can fix it by changing the fonts from Tahoma to MSGOTHIC for all the contrls, but I don't want to do it.
    Environment:
    My PC:Windows7 64bit /Visual Studio 9.0.30729.1 / .NET Framework 3.5 SP1
    Server:Windows Server 2003 R2 /Visual Studio 9.0.30729.1 / .NET Framework 3.5 SP1
    Garbled characters sample:
    FontLink - SystemLink
    Please let me know if you need any more information. I would appreciate your advice!

    Hi nino_miya,
    According to your description, when you display the report in client side, characters are garbled.
    In your scenario, please check if the Language is the same as the report on production server. Also please check if the data of Tahoma in registry on client PC is the same as server. If those two settings are the same, please specify font of the each
    control as MSGOTHIC manaually on client PC.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Context Indexes and ignoring characters

    So, we're trying to get a text index to ignore apostrophe's.
    insert into table values ('Arby''s');We want the above entry to be located with either of the following queries:
    select *
    from table
    where contains(field, 'Arbys')>0and also
    select *
    from table
    where contains(field, 'Arby''s')>0The second SQL works already, it's the former search that is finding no records. I tried adding an apostrophe to the STOPLIST, but it didn't seem to make a difference. Is there another tweak I can make, so that this works? Or am I going to need to create 2 columns, one without special characters which actually has the context index on it?
    Thanks,
    --=Chuck

    So this is what I've setup:
    SQL> begin
      2 
      3   
      4 
      5    CTX_DDL.CREATE_STOPLIST(stoplist_name => 'TEST_APOSTROPHE',
      6                            stoplist_type => 'BASIC_STOPLIST');
      7 
      8    CTX_DDL.ADD_STOPWORD(stoplist_name => 'TEST_APOSTROPHE',
      9                         stopword      => ''''); 
    10                    
    11 
    12  end;
    13  /
    PL/SQL procedure successfully completed.
    SQL> create table test_apos (name varchar2(100));
    Table created.
    SQL> CREATE INDEX TEST_APOS_NAME_CTX ON TEST_APOS
      2  (NAME)
      3  INDEXTYPE IS CTXSYS.CONTEXT
      4  PARAMETERS('STOPLIST TEST_APOSTROPHE SYNC(ON COMMIT)');
    Index created.
    SQL> insert into test_apos values ('Arby''s');
    1 row created.
    SQL> commit;
    Commit complete.The following usages of CONTAINS( ) will find the record, but, they either explicitly mention the apostrophe, or, they look for the string prior to the apostrophe. I expect all of these to work regardless of the STOPLIST entry:
    SQL> select * from test_apos where contains (name, 'Arby') > 0;
    NAME
    Arby's
    SQL>  select * from test_apos where contains (name, 'Arby%') > 0;
    NAME
    Arby's
    SQL> select * from test_apos where contains (name, 'Arby''s') > 0;
    NAME
    Arby's
    SQL> select * from test_apos where contains (name, '$(Arby)') > 0;
    NAME
    Arby'sNone of the following work (incl your suggestion, which I greatly appreciate, btw):
    SQL> select * from test_apos where contains (name, 'Arbys') > 0;
    no rows selected
    SQL> select * from test_apos where contains (name, 'Arby%s') > 0;
    no rows selected
    SQL> select * from test_apos where contains (name, 'Arbys%') > 0;
    no rows selected
    SQL> select * from test_apos where contains (name, '$(Arbys)') > 0;
    no rows selected--=cf

  • JDBC2.0 API and Multi-Bytes Characters

    I use the JDBC2.0 API with the thin Driver816 for jdk1.2.X,
    it works well with English characters ,
    but i get wrong with Multi-Bytes Characters.
    Does anyone else know the reason?
    Thanks in advance.

    I have the same problem!!!!!!!!!!!
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by huang Jian-chang:
    I use the JDBC2.0 API with the thin Driver816 for jdk1.2.X,
    it works well with English characters ,
    but i get wrong with Multi-Bytes Characters.
    Does anyone else know the reason?
    Thanks in advance.<HR></BLOCKQUOTE>
    null

  • DEFECT: (Serious!) Truncates display of data in multi-byte environment

    I have an oracle 10g database set up with the following nls parameters:
    NLS_CALENDAR      GREGORIAN
    NLS_CHARACTERSET      AL32UTF8
    NLS_COMP      LINGUISTIC
    NLS_CURRENCY      $
    NLS_DATE_FORMAT      DD-MON-YYYY
    NLS_DATE_LANGUAGE      AMERICAN
    NLS_DUAL_CURRENCY      $
    NLS_ISO_CURRENCY      AMERICA
    NLS_LANGUAGE      AMERICAN
    NLS_LENGTH_SEMANTICS      CHAR
    NLS_NCHAR_CHARACTERSET      UTF8
    NLS_NCHAR_CONV_EXCP      TRUE
    NLS_NUMERIC_CHARACTERS      .,
    NLS_RDBMS_VERSION      10.2.0.3.0
    NLS_SORT BINARY
    NLS_TERRITORY      AMERICA
    NLS_TIMESTAMP_FORMAT      DD-MON-RR HH.MI.SSXFF AM
    NLS_TIMESTAMP_TZ_FORMAT      DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_TIME_FORMAT      HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT      HH.MI.SSXFF AM TZR
    I am querying a view in sqlserver 2000 via an odbc database link.
    When I query a 26 character wide column in the view in sql developer, it will only return up to 13 characters of the data.
    When I query the exact same view in the exact same sql server database from the extact same oracle database using the exact same odbc database link using sql navigator, I get the full 26 characters worth of data.
    It also works just fine from the sql command line tool from 10g express.
    Apparently, sql developer is confused about how to handle multi-byte data. If you ask it the length of the data in the column, it will tell you 26, but it will only show you 13.
    I have found a VERY PAINFUL work around, to do a cast(column_name as varchar2(26) when I query it. But I've got hundreds of views and queries...

    In all other respects, the settings I have appear to be working correctly.
    I can enter multi-byte characters into the sql worksheet to create a package, save it, and re-open the package with the multi-byte characters still visible.
    I'm using a fallback directory for my jdk with the correct font installed, so I can see and edit multi-byte data in the data grids.
    In this case, I noticed the problem on a column that only contains the standard ascii letters and digits.
    Environment->Encoding = UTF-16
    All the fonts are set to a font that properly displays western and ge'ez characters. The font has been in use for years, and is working correctly in all other circumstances.
    The Database->NLS Parameters tab under sql developer preferences shows:
    language: American
    territory : American
    sort: binary
    comp: binary
    length: char (I've also tried byte)
    If there are other settings that you think might be relevant, please let me know.
    I've done some more testing. I created an oracle table with a single column and did an insert into ... select from statement across the database link. The correct, full-length data appeared in the oracle table.
    So, it's not a matter of whether the data is being returned or not, it is. It is simply not being displayed correctly. It appears that sql developer is making some unwarranted decisions about the datatable across the database link when it decides to display the data, because sql plus and sql navigator have no such issues.
    This is really a very serious problem, because if I cannot trust the data the tool shows me, I cannot trust the tool.
    It is also an invitation to make an error based upon the erroneous data display.

  • Handling Tab Delimited File generation in non-unicode for multi byte lang

    Hi,
    Requirement:
    We are generating a Tab Delimited File in different languages (Single Byte and Multi Byte) and placing the files at application server.
    Problem:
    Our system is a Non-unicode system so we are facing problems with generation of Tab delimited file for multibyte languages like Russian, Japanese, Chinese etc.,
    I am actually using data: d_tab TYPE X value '09' but it dont work for multi byte. I cant see tab delimited file at application server path.
    Any thoughts about how to proceed on this issue?Please let me know.
    Thanks & Regards,
    Pavan

    >
    Pavan Ravikanti wrote:
    > Thanks for your answer but do you reckon cl_abap_char_utilities will be a work around for data: d_tab type X VALUE '09' .
    > Pavan.
    On a non-unicode system the X Variant is working, but not on a unicode system. Here you must use the class. On the other hand you can use the class on a non-unicode system und your char var will always be correct (one byte/twobyte depending on which system your report is running).
    What you are planning to do is to put a file with an amount of possible characters into a system with has a less amount of characters. Thats not working in no way.
    What you can do is to build up a multi-code-page system where the codepage is bound to the user or bound to the logon-language. Here you you can read and process textfiles in several codepages - but not a textfile in unicode. You have to convert the unioce textfile into a non-unicode textfile before processing it.
    Remember that SAP does not support multi-code-page Systems anymore and multi-code-page systems will result in much more work when converting the system to unicode.
    Even non-unicode system will not be maintained by SAP in the near future.
    What you encounter here are problems for what unicode was developped. A unicode system can handle non-unicode textfiles, but the other way round will always lead to problems which cant be solved.

  • Multi-byte character encoding issue in HTTP adapter

    Hi Guys,
    I am facing problem in the multi-byte character conversion.
    Problem:
    I am posting data from SAP CRM to third party system using XI as middle ware. I am using HTTP adapter to communicate XI to third party system.
    I have given XML code as UT-8 in the XI payload manipulation block.
    I am trying to post Chines characters from SAP CRM to third party system. junk characters are going to third party system. my assumption is it is double encoding.
    Can you please guide me how to proceed further.
    Please let me know if you need more info.
    Regards,
    Srini

    Srinivas,
    Can you go through the url:
    UTF-8 encoding problem in HTTP adapter
    ---Satish

  • Problem to display japanese/multi-byte character on weblogic server 9.1

    Hi experts
    We are running weblogic 9.1 on linux box [REHL v4] and trying to display Japanese characters embedded in some of html files, but Japanese characters are converted into a question mark [?]. The html files that contain Japanese characters are stored properly in the file system and retained the Japanese characters as they should be.
    I changed character setting in the html header to shift_jis, but no luck. Then I added the encoding scheme for shift_jis in jsp_description and charset-parameter section in weblogic.xml but also no luck.
    I am wondering how I can properly display multi-byte characters/Japanese on weblogic server without setting up internationalization tools.
    I will appreciate for your advice.
    Thanks,
    yasushi

    This was fixed by removing everything except teh following files from the original ( 8.1 ) domain directory
    1. config.xml
    2. SerializedSystemIni.dat
    3. *.ldift
    4. applications directory
    Is this a bug in the upgrade tool ? Or did I miss a part of the documentation ?
    Thanks
    --sony                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem printing simplified Chinese on PM4i printer using multi-byte data

    I am new to printing data in Simplified Chinese and have tried for a period of time to get it to work but it is not working. I would appreciate any help.
    This is what I have:
    1. Chinese data stored as multi-byte data in oracle 10g db. It is in one of the attribute fields on the mtl_system_items table. The data field it is stored in is defined as varchar2(240). I have to extract that data and print it out as simplified Chinese characters on 3x4 label stock on PM4i printer which is setup to use IPL as the default language.
    2. Purchased the simplified Chinese font kit ( compact flash card ) and plugged it into the compact flash port on back of the printer. The simplified Chinese font is assigned.
    3. Created simple program to build the label file to send to the printer to print the Chinese glyphs. I expected 3 to print but it only prints 1 Chinese glyph and that is not the correct.
    a. Data shown in Chinese
    传感器
    b. Data in hex format => E4BCA0E6849FE599A8
    c. Data in utf8 => ä¼ æ„Ÿå™¨
    d. Simple oracle pl/sql program code to extract data from oracle and create the format file for printing
    CREATE OR REPLACE PROCEDURE china_test_label1 is
    hold_length number;
    v_hold_armpart varchar2(240):= null;
    v_hold_line varchar2(500);
    v_file_name varchar2(100) := 'chlabel1.txt';
    v_file_line1 varchar2(100) := '<STX><ESC>C<ETX>';
    v_file_line2 varchar2(100) := '<STX><ESC>P<ETX>';
    v_file_line3 varchar2(100) := '<STX>E4;F4;<ETX>';
    v_file_line4 varchar2(100) := '<STX>H00;o0200,0200;c60;k32;d0,30;<ETX>';
    v_file_line5 varchar2(100) := '<STX>L1;o102,102;f0;l575;w5;<ETX>';
    v_file_line6 varchar2(100) := '<STX>R<ETX>';
    v_file_line7 varchar2(100) := '<STX><ESC>E4<CAN><ETX>';
    v_file_line8 varchar2(100) := '<STX><ETB><ETX>';
    v_file_line varchar2(500);
    v_file_handle UTL_FILE.file_type;
    v_submit_status number;
    v_out_path_name varchar2(50);
    v_export_path_name varchar2(50);
    -- Program Starts Here
    BEGIN
    fnd_file.put_line(fnd_file.log, '------- Starting Label job -------');
    SELECT description
    INTO v_out_path_name
    FROM fnd_lookup_values
    WHERE lookup_type = 'ARM_DATA_FILE_OUT_PATH'
    AND lookup_code = '$FLMARM_TOP';
    v_file_handle := utl_file.fopen(v_out_path_name, v_file_name, 'W');
    v_file_line := v_file_line1;
    utl_file.put_line(v_file_handle, v_file_line);
    v_file_line := v_file_line2;
    utl_file.put_line(v_file_handle, v_file_line);
    v_file_line := v_file_line3;
    utl_file.put_line(v_file_handle, v_file_line);
    v_file_line := v_file_line4;
    utl_file.put_line(v_file_handle, v_file_line);
    v_file_line := v_file_line5;
    utl_file.put_line(v_file_handle, v_file_line);
    v_file_line := v_file_line6;
    utl_file.put_line(v_file_handle, v_file_line);
    v_file_line := v_file_line7;
    utl_file.put_line(v_file_handle, v_file_line);
    BEGIN
    select attribute13
    INTO v_hold_armpart
    FROM apps.mtl_system_items
    WHERE segment1 = '20928536'
    AND organization_id = 282;
    EXCEPTION
    WHEN others THEN
    v_hold_armpart := 'nothing';
    END;
    v_file_line := '<STX>'||v_hold_armpart||'<CR><ETX>';
    utl_file.put_line(v_file_handle, v_file_line);
    v_file_line := v_file_line8;
    utl_file.put_line(v_file_handle, v_file_line);
    utl_file.fclose(v_file_handle);
    fnd_file.put_line(fnd_file.log, '-------------------------------------------');
    fnd_file.put_line(fnd_file.log, '-- end of job ');
    fnd_file.put_line(fnd_file.log, '-------------------------------------------');
    END china_test_label1;
    show errors;
    e. i do lpr -P printer filename to print the file. here is the file contents :
    <STX><ESC>C<ETX>
    <STX><ESC>P<ETX>
    <STX>E4;F4;<ETX>
    <STX>H00;o0200,0200;c60;k32;d0,30;<ETX>
    <STX>L1;o102,102;f0;l575;w5;<ETX>
    <STX>R<ETX>
    <STX><ESC>E4<CAN><ETX>
    <STX>ä¼ æ„Ÿå™¨<CR><ETX>
    <STX><ETB><ETX>
    i think the issue here may be with formating the mulit-byte data into format it can be printed using the c60 font. Any
    coding examples would be greatly appreciated

    Hi,
    Welcome you post on the forum.
    However, this is not the right forum for you. It is only for SAP Business One user. Please search entire forums first to find which one is more proper.
    However, this issue may not be related to SAP at all. Search on the web would be better.
    Thanks,
    Gordon

  • CUSTOM Service - multi Byte character issue

    Hi Experts,
    I wrote a custom Service. What this service is doing, its id reading some data from Database and then generates CSV report. Code is working fine. But if we have multi - byte characters in data, then these characters are not properly shown in report. Given below is my service code :
    byte bytes[] = CustomServiceHelper.getReport(this.m_binder,providerName);
                        DataStreamWrapper wrapper = new DataStreamWrapper();
                        wrapper.m_dataEncoding="UTF-8";
                        wrapper.m_dataType="application/vnd.ms-excel;charset=UTF-8";
                        wrapper.m_clientFileName="Report.csv";
                        wrapper.initWithInputStream(new ByteArrayInputStream(bytes), bytes.length);
                        this.m_service.getHttpImplementor().sendStreamResponse(m_binder, wrapper);
    NOTE - This code is working fine on my local ucm (windows) for multi-byte characters. But When I install this service on our DEV and Staging servers (SOLARIS), then multi-byte characters issue occurs.
    Thanks in Advance..!!
    Edited by: user4884609 on May 17, 2011 4:12 PM

    Please Help

  • Handling multi byte languages in Web Service

    Hi,
    I am calling a web service and its working fine with English language i.e web service is returning correct parameters with English.
    But it's returning me Junk characters when i call web service with multi byte languages like Japanese, Russian etc.,
    Generally while configuring Web Service or calling a web service using proxy - it asks for a user id/ Pwd but not a logon language (unlike while you login SAP it asks for Logon Language) so i am thinking since there is no option to enter log on language, its taking a default language i.e English so when i am passing japanese its returning me Junk Values.
    Can any one please help me with this? How to handle multi byte webservice call? I am using ECC 5.0.
    Thanks & Regards,
    Pavan.

    I appreciate your thought but our webservice must be able to handle multiple languages not only Japanese. Users might call webservice in any language they prefer. If i change it my default to Japanese, i will have problem when users call webservice in Russian.

  • Multi-byte character

    If DATABASE CHARACTER SET is UTF-8 than
    Than can i use VARCHAR2 to store multi-byte character or i still have to use
    nvarchar2
    also vachar2(1),nvarchar2(1) can store how much (max) bytes in case of UTF-8 CHARACTER SET

    If you create VARCHAR2(1) then you possibly can not store anything as your first character might be multibyte.
    My recommendation would be to consider defining by character rather than by byte.
    CREATE TABLE tbyte (
    testcol VARCHAR2(20));
    CREATE TABLE tchar (
    testcol VARCHAR2(20 CHAR));The second will always hold 20 characters without regard to the byte count.
    Demos here:
    http://www.morganslibrary.org/library.html

  • Where is the Multi-Byte Character.

    Hello All
    While reading data from DB, our middileware interface gave following error.
    java.sql.SQLException: Fail to convert between UTF8 and UCS2: failUTF8Conv
    I understand that this failure is because of a multi-byte character, where 10g driver will fix this bug.
    I suggested the integration admin team to replace current 9i driver with 10g one and they are on it.
    In addition to this, I wanted to suggest to the data input team on where exactly is the failure occured.
    I have asked them and got the download of the dat file and my intention was to findout where exactly is
    that multi-byte character located which caused this failure.
    I wrote the following code to check this.
    import java.io.*;
    public class X
    public static void main(String ar[])
    int linenumber=1,columnnumber=1;
    long totalcharacters=0;
    try
    File file = new File("inputfile.dat");
    FileInputStream fin = new FileInputStream(file);
    byte fileContent[] = new byte[(int)file.length()];
    fin.read(fileContent);
    for(int i=0;i<fileContent.length;i++)
       columnnumber++;totalcharacters++;
       if(fileContent<0 && fileContent[i]!=10 && fileContent[i]!=13 && fileContent[i]>300) // if invalid
    {System.out.println("failure at position: "+i);break;}
    if(fileContent[i]==10 || fileContent[i]==13) // if new line
    {linenumber++;columnnumber=1;}
    fin.close();
    System.out.println("Finished successfully, total lines : "+linenumber+" total file size : "+totalcharacters);
    catch (Exception e)
    e.printStackTrace();
    System.out.println("Exception at Line: "+linenumber+" columnnumber: " +columnnumber);
    }But this shows that the file is good and no issue with this.
    Where as the middleware interface fails with above exception while reading exactly the same input file.
    Anywhere I am doing wrong to locate that multi-byte character ?
    Greatly appreciate any help everyone !
    Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    My challenge is to spot the multi-byte character hidden in this big dat file.
    This is because the data entry team asked me to spot out the record and column that has issue out of
    lakhs of records they sent inside this file.
    Lets have the validation code like this...
       if( (fileContent<0 && fileContent[i]!=10 && fileContent[i]!=13) || fileContent[i]>300) // if invalid
    {System.out.println("failure at position: "+i);break;}lessthan 0 - I saw some -ve values when I was testing with other files.
    greaterthan 300 - was a try to find out if any characters exceeds actual chars. range.
    if 10 and 13 are for line-feed.
    with this, I randomly placed chinese, korean characters and program found them.
    any alternative (better code ofcourse) way to catch this black sheep ?
    Edited by: Sanath_K on Oct 23, 2009 8:06 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Can't transfer tunes to ipod

    I have a 60GB ipod and since upgrading to itunes 7.0, every time I try to transfer my library, I get the error message: "ipod cannot be updated. The disk could not be read from or written to" I've tried the all the advice at http://docs.info.apple.co

  • Status profile - Quality Info record

    Hi, Pls explain about status profile: QM_P_DOL - Status check DOL. Waht is DOL? Why is required? Reg, RPV.

  • I give up - how are parent/child .chm links maintained?

    I've been following the letter of the law (help) for three versions now - RH6, RH7, and now RH8 - and I give up. What is the magical mystery proper way of maintaining parent/child .chm links in RH8??? Current issue: Since converting projects to RH8,

  • How can I get a split sceen feature on my Firefox 5.0, with Windows Vista?

    We are trying to add Split Panel v 1.0 to Firefox V 5.0. However, when installing the application and then rebooting Firefox and then trying to use it, it redirects us to the current URL: https://addons.mozilla/en-US/firefox/addon/split-panel/.......

  • HT202879 how do I make columns and rows?

    I have to take the minutes for meetings.  I normally have now problem creating a document with 4 columns and 5-6 rows.  Now since I updated I can no longer figure out how to do it.