Writing chinese character into a file

Hi,
I need to write chinese characters into a file,I used FileOutputStream, using the method write(byte[] b)...
whereby I will convert the chinese word into bytes....
but it couldn't work...
Please Help!!

you can write the unicode hex string (e.g. 606D559C53D18D22 for Gong Xi Fa Chai) into a text file by using the following code
          PrintWriter out2 = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream("chinese_out.txt", false), "UTF-8")));
               int countChineseChar = chineseHex.length()/4;
               int index = 0;
               String c = "";
               int b;
               for(int i=0; i<countChineseChar-1; i++)
                    c = new String(chineseHex.substring(index, index+4));
                    b = Integer.parseInt(c, 16);
                    out2.write(b);
                    index+=4;
Note that the OutputStreamWriter uses the UTF-8 to encode the unicode hex. I'm assuming that the hex is fixed at 4 digits each character
syam

Similar Messages

  • How to pdf of chinese character into words

    how to converge a pdf file of chinese character into WORD.

    Hi,
    Unfortunately our conversion engine cannot convert text, such as Chinese.  It maybe something that we add in the future however it is not available at this time.
    What languages are supported for OCR by Adobe ExportPDF?
    Adobe ExportPDF supports the following languages for OCR:
    English (US)
    English (UK)
    German
    Spanish
    French
    Italian
    Japanese
    Please refer to the article mentioned below : http://forums.adobe.com/docs/DOC-1812
    ~Pranav

  • Error while writing the data into the file . can u please help in this.

    The following error i am getting while writing the data into the file.
    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension">
    <part name="code">
    <code>null</code>
    </part>
    <part name="summary">
    <summary>file:/C:/oracle/OraBPELPM_1/integration/orabpel/domains/default/tmp/
    .bpel_MainDispatchProcess_1.0.jar/IntermediateOutputFile.wsdl
    [ Write_ptt::Write(Root-Element) ] - WSIF JCA Execute of operation
    'Write' failed due to: Error in opening
    file for writing. Cannot open file:
    C:\oracle\OraBPELPM_1\integration\jdev\jdev\mywork\
    BPEL_Import_with_Dynamic_Transformation\WORKDIRS\SampleImportProcess1\input for writing. ;
    nested exception is: ORABPEL-11058 Error in opening file for writing.
    Cannot open file: C:\oracle\OraBPELPM_1\integration\jdev\jdev\mywork\
    BPEL_Import_with_Dynamic_Transformation
    \WORKDIRS\SampleImportProcess1\input for writing. Please ensure 1.
    Specified output Dir has write permission 2.
    Output filename has not exceeded the max chararters allowed by the
    OS and 3. Local File System has enough space
    .</summary>
    </part>
    <part name="detail">
    <detail>null</detail>
    </part>
    </bindingFault>

    Hi there,
    Have you verified the suggestions in the error message?
    Cannot open file: C:\oracle\OraBPELPM_1\integration\jdev\jdev\mywork\BPEL_Import_with_Dynamic_Transformation\WORKDIRS\SampleImportProcess1\input for writing.
    Please ensure
    1. Specified output Dir has write permission
    2. Output filename has not exceeded the max chararters allowed by the OS and
    3. Local File System has enough space
    I am also curious why you are writing to a directory with the name "..\SampleImportProcess1\input" ?

  • Output chinese character to CSV file in UNIX

    Hi
    I encountered ABAP dump whenever output chinese character to CSV file in UNIX in ECC6. Error show as
    "At the conversion of a text from codepage '4102' to codepage '1100':
    - a character was found that cannot be displayed in one of the two
    codepages;
    - or it was detected that this conversion is not supported"
    The program with coding of statement OPEN DATASET xxxxx FOR OUTPUT IN TEXT MODE  ENCODING NON-UNICODE. Reason to output to OPEN statement to non-unicode as users would like to open the csv file thru Excel directly. They do not wish to open the text file in Excel. Can Experts please share with me how to overcome the problem?
    Thanks
    Kang Ring

    May be you could give a try with the following code and check
    OPEN DATASET xxxxx FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE CODEPAGE '4103'.
    Vikranth

  • Insert/Retrieve chinese character into/from MS Access

    Hi all,
    I want to know if there is concrete answer for the problem of maintaining chinese character in MS Access using jdbc/odbc. I have searched the forum but seems there is no working solution, am I correct?
    I am writing a db maintenace program in Win XP, using MS Access 2000, jdbc/odbc and Swing. I also got ?????? when retrieving chinese characters from Access. As I am not good at chinese encoding scheme, can anyone tell me how to solve the problem? How to retrieve chinese characters and display in a JTable/text field and how to save chinese characters into MS Access?
    Pls give me a hand, thanks in advance.

    If all else fails you can just encode them into something that is stored into MS Access. For example you could just use base64 encoding.

  • How to put Chinese character in jar file by java.util.jar.Manifest?

    Now I want to develop a simple package tool which can modify some property in manifest.mf of jar files,but the Manifest class's putValue method only can correctly save English character.why?
    And how can I put Chinese character?
    the code is:
    Attributes ab = mf.getMainAttributes();
    ab.putValue("agent-Name", agent);

    Attribute values can contain any character and it will be UTF-8 encoded when written to the manifest, according to Javadoc.
    What makes you think that this mechanism fails? What do you see instead of the Chinese character? And what tool/editor/program you use to see it? I did not try myself, but according to the Javadoc there should be no problem.

  • Cannot insert Chinese character into nvarchar2 field

    I have tested in two environments:
    1. Database Character Set: ZHS16CGB231280
    National Character Set: AL16UTF8
    If the field type of datatable is varchar2 or nvarchar2, the provider can read and write Chinese correctly.
    2. Database Character Set:WE8MSWIN1252
    National Character Set: AL16UTF8
    The provider can not read and write Chinese correctly even the field type of datatable is nvarchar2
    I find that for the second one, both MS .NET Managed Provider for Oracle and Oracle Managed Data Provider cannot read and write NCHAR or NVARCHAR2 fields. The data inserted into these fields become question marks.
    Even if I changed the NLS_LANG registry to SIMPLIFIED CHINESE_CHINA.ZHS16CGB231280, the result is the same.
    For the second situation, only after I change the Database Character Set to ZHS16CGB231280 with ALTER DATABASE CHARACTER SET statement, can I insert Chinese correctly.
    Does any know why I cannot insert Chinese characters into Unicode fields when the Database Character Set is WE8MSWIN1252? Thanks.
    Regards,
    Jason

    Hi Jason,
    First of all, I am not familiar with MS .NET Managed Provider for Oracle or Oracle Managed Data Provider.
    How did you insert these Simplified Chinese characters into the NVARCHAR2 column ? Are they hardcoded as string literals as part of the SQL INSERT statement ? If so, this could be because, all SQL statements are converted into the database character set before they are parsed by the SQL engine; hence these Chinese characters would be lost if your db character set was WE8MSWIN1252 but not when it was ZHS16CGB231280.
    Two workarounds, both involved the removal of hardcoding chinese characters.
    1. Rewrite your string literal using the SQL function UNISTR().
    2. Use bind variables instead of text literals in the SQL.
    Thanks
    Nat

  • How to use OCR Font A type by the time of writing some text into Pdf fil

    Hi,
    I am generating one pdf file in java. How can I use OCR Font A for text of pdf file ..Please can any one help where can I get OCR Font A and how to use that one in java ... I want to write some text into pdf file and that text should use OCR Font A family ...
    Thanks.

    This document shows how to disable OCR during conversion; just do the opposite: https://forums.adobe.com/docs/DOC-3062

  • Is it possible to read/write Chinese character into Oracle 8i(WE8ISO8859P1) in Applet

    I can display Chinese character in swing label or text field, however, when I read
    the Chinese character data from (or write to) Oracle DB, it shows ??? instead. I can't
    change the code page of my DB, (if use ZHT16Big5 instead of WE8Iso8859P1 as the DB page
    code, than everything is OK. :< ) is there any solution for this?
    Server:
    DB:Oracle8i(8.1.6)with Character set: WE8ISO8859P1
    System Environment:NLS_LANG=American_America.WE9ISO8859P1
    OS: Win2000 Advance Server(NLS:950 Traditional Chinese)
    client:
    Applet (written by JDeveloper 3.2) compiled with code: ISO8859_1
    JDBC Driver: Oracle JDBC Thin Driver (ver 8.1.7 or 8.1.6)
    Browser: IE5.5 (with code Western Europe(ISO) or UTF-8 or Traditional Chinese...)
    null

    Eric,
    There is no good way to do this. In your ASP/ADO application I think you are creating a garbage in garbage out situation. Because the client NLS_LANG matches the DB characterset no conversion takes place. Therefore your chinese characters get inserted in the DB. But the data is really garbage.
    When you use Java thin driver a conversion automatically takes place from UCS-2 -> WE8ISO8859P1. The Chinese characters in UCS-2 have no equivalent code point in WE8ISO8859P1, so you end up with replacement characters ??

  • How to writing the data into the file at the same frequency of data acquisition using myRIO

    Hi everyone,
    I have a question regarding data acquisition fequency and data recording frequency of myRIO. Hope you guys can help me out.
    Basically, I want to acquire voltage input at analog input 0 at the frequency of 1kHz and then write the data into a file (tdms format). 
    However, I always found there were only 55 or 56 data points recorded every second in the data file (see the excel sheet). 
    To confirm my data acquisition was performed at the correct frequency, I added a small function in the main loop to indicate the time spent between two acquisition events. 
    To my surprise, the period of data acquistion is correct (1ms or 1kHz) but there are only 55 or 56 data point per second recorded in the data file.
    How can I record every data point acquired by the analog input?
    Thank you!
    P.S. I am very new to myRIO. How can I manually set the system time for myRIO? The default time of my myRIO is wrong. 
    Best,
    Tengyang
    Attachments:
    test result.xlsx ‏16 KB
    Main with timed loop.vi ‏122 KB
    test result.xlsx ‏16 KB

    Have a look at the Jakarta POI project, they have a Java API for creating Word documents.
    http://jakarta.apache.org/poi/hwpf/index.html

  • Need help on writing chinese character on Q10

    Could anyone help me how to write chinese character on English platform without changing the whole language to chinese?
    Thanks

    http://www.youtube.com/watch?feature=player_embedded&v=euRqXNYdUiE
    Blackberry Handwriting support english and chinese

  • Export arabic character into csv file turns into question mark in sql dev

    Hi,
    I am trying to export a table's output that contains some arabic and english mixed data, when I try to export it in csv, all the arabic characters change into question mark (?) but the same export is working fine on .xls or .xlsx.
    Since we have to export a huge data and csv is much faster thar .xls, kindly let me know why it is happening and what is the solution for this.
    Well, we are on Oracle 11gR2 and Sql Dev is 3.1
    Appreciate your time and experience sharing.
    Regards.

    Hi,
    Since you say it works for xls but not csv, and the only applicable preference setting ( Tools|Preferences|Database|Utilities|Export|Encoding ) should apply to all export formats, I would imagine this is a bug. Especially if the encoding specified in Preferences is consistent with the client OS settings. I was not able to find any prior bug logged against the Export utility for this issue.
    I logged a bug for this:
    Bug 13993410 - FORUM: ARABIC CHARACTER ENCODING RESPECTED FOR XLS BUT NOT CSV
    Regards,
    Gary
    SQL Developer Team

  • Writing generated XML into a file after comparing with other XML

    Hi,
      I have completed the comparison of two XML now I have a requirement to concat these two xml but also need to append the XML with a status node that if after comparing the two XML output is Y or N so if it is Y then a node with
    <status>Y</status>
    <from table>t1</from table>
    then completing those task I need to write it in a file
    declare
        p_emp_info   CLOB;
      l_emp_tab        xmlsequencetype := xmlsequencetype();
    BEGIN
      FOR i IN (SELECT id from emp WHERE emp_name='ABC') LOOP
        l_emp_tab.extend;
        SELECT XMLELEMENT("ABCD",
               XMLELEMENT("id",i.id))
          INTO l_emp_tab(i)
          FROM dual;
    END LOOP;
      SELECT XMLELEMENT("EMP"
                           ,XMLAGG(t.column_value))
        INTO p_emp_info  
        FROM TABLE(l_emp_tab) t;
        --Dbms_Output.put_line(getclobval(1,2));
    EXCEPTION
        WHEN OTHERS THEN
       Dbms_Output.put_line(SQLCODE||sqlerrm);
    END ;
    I am using this query but it is giving me an error that expression is of wrong type  at this line {  INTO l_emp_tab(I) }
    I am unable to find out the error that what I am missing here !!

    You've changed the datatype of i from the example that Odie gave you in
    repeating nodes using FOR loop but when concating XML string then concating only last iteration of FOr loop ??
    In his example, i was a number.  In your above code, i is now the rowset for a cursor.
    You could rewrite your version to look like
    declare
      p_emp_info     XMLTYPE;
      l_emp_tab      xmlsequencetype := xmlsequencetype();
      l_pos          PLS_INTEGER;
      CURSOR c_info IS
        SELECT id
          from emp
         WHERE emp_name='ABC';
    BEGIN
      FOR r_info IN c_info LOOP
        l_emp_tab.extend;
        l_pos := c_info%ROWCOUNT;
        SELECT XMLELEMENT("ABCD",
               XMLELEMENT("id",r_info.id))
          INTO l_emp_tab(l_pos)
          FROM dual;
      END LOOP;
      SELECT XMLELEMENT("EMP"
                           ,XMLAGG(t.column_value))
        INTO p_emp_info 
        FROM TABLE(l_emp_tab) t;
      --Dbms_Output.put_line(p_emp_info.getclobval());
    END ;
    You can't use the c_info%ROWCOUNT in the INTO clause, hence the need for l_pos.
    Or you could rewrite it to be
    declare
      p_emp_info   XMLTYPE;
      l_clob       CLOB;
    BEGIN
      SELECT XMLElement("EMP",
               XMLAgg(XMLElement("ABCD",
                        XMLElement("id",e.id))))
        INTO p_emp_info
        FROM emp e
       WHERE emp_name = 'ABC';
      SELECT XMLSERIALIZE(DOCUMENT p_emp_info AS CLOB)
        INTO l_clob
        FROM DUAL;
      Dbms_Output.put_line(l_clob);
    END;
    Both produce the same XML.

  • Writing BLOB column into a file (NT/WinWord)

    I need to create
    a file on NT and extract the contents of a BLOB
    column and put it in the file. It's a WORD-document
    and I'm using 8.1.7 on NT4SP5. I'm thinking some
    combination of the LOB package and UTL_FILE, but
    some far no luck. Example code would help me.
    Thanks in advance
    Dannys

    dbms_lob, utl_lob is not supported by oracle, written by an in-
    house analyst to demonstrate a concept.

  • Trouble in writing Chinese Characters into database

    I'm developing a JSP web site using ACCESS2002, Tomcat4.0.4 and J2EE 1.4.1. I found my data(chinese chatacters) in mess when I wrote it in to database through sun's own JDBC-ODBC driver though it is displayed correctly in web-browser. I tried in JSP, Servlet and JavaBean, and the situation seems no better.
    Is it the problem of sun's JDBC-ODBC driver or is there a solution to this problem?
    Eager to hear a reply, thank millions!!

    Have you tried something like the following?
    first, set this page quality:
    <%@ page contentType="text/html;charset=Big5"%>
    then, change the Chinese string to this:
    String zhtounicode=new String(yourzhstring.getBytes("8859_1"));
    then, do with the converted string.

Maybe you are looking for

  • Problem with Logic Board in a Macbook Pro 15" 2011 in Argentina

    Hi I am from Argentina and I am reporting a problem I've had a few weeks ago: I was working with my computer (MacBook Pro 15 inch Late 2011) and it suddenly stopped working; the screen was frozen. I proceeded to restart it, but it couldn't enter the

  • Enter a true account assignment object with revenues while reversing FB08

    Hi All When I am reversing the document through FB08 I am getting the warning messege "Enter a true account assignment object with revenues" Message no. KI166 Diagnosis You made an account assignment for 31211100, a revenue element, in controlling ar

  • IPhone not syncing all pictures

    I've been having this problem for awhile now & thought it had something to do with the iPhone 4 because I didn't have this issue when I had the iPhone 3GS.  When I try to sync all photos including videos into my iPhone - about 4,900, only about 4,200

  • ERROR HANDLING FOR CLIENT_OLE2 FUNCTIONS

    We have added spell checking to our application using the Client_OLE2 WebUtil function using the example in the knowledge base. Unfortunately the example does not check for errors. Can someone direct me to documentation that shows return codes for th

  • External hardrive problem

    I have a la cie ext. hard drive that I have been using for about 5 months, today I plugged it in and have a message saying... .the disc you inserted is not readable by this computer. I have buttons saying initialize ignore and eject. I have to take s