Unicode encoding in java

Hi all,
I have a file which contain data in UTF-16BE format, i want to send that data to SMS, but to send data in SMS i usually have in following format
cmpmessage="\u0645\u0639\u0632\u0632\u0635\u0627\u0631\u0641"
Now when i copy data from file it contains some unreadable format.
Can any one guide that how i can convert that file in \u sequences.
Regards,
imran

hi,
when i send message by this code it shows boxes on mobile
in = new InputStreamReader(new FileInputStream(file),"UTF-16BE");
buf_reader = new BufferedReader(in);
line = buf_reader.readLine();
but when i send message by following line mobile shows proper arabic
line="\u0645\u0639\u0632\u0632\u0635\u0627\u0631\u0641";
Regards,
imran

Similar Messages

  • Java unicode encoding

    hello,
    possibly this is very simple, so dont laugh. an application i'm writing displays an XML document as a JTree for editing. Within the XML document I have hardcoded Unicode IPA extensions, which show up perfectly in the JTree and JTextAreas. The problem is I dont know how to copy the original Unicode encoding into another document. I want to be able to write the original encoding (something like ʃ) to another file. As it is, it seems to be getting converted into a string and then when I copy it, the new document doesnt contain the Unicode and wont display the symbols. Thanks for any help

    I have the similar problem as you.
    I try to write an xml file encoded with UTF-8 to Unix Solaris. I have set locale to UTF-8 on Unix . I compile my java source under Windows machine with ant which javac is encoded in UTF-8. Database(Informix) is also set to UTF-8. I can enter special characters such as Spanish from web page and save to Database and bring it back to web page. It all displays correctly. But when i try to get the data with special characters from database and write a xml file into Unix and I use different editors such as Word, Notepad, Unix vi, UltraEditor to open this xml file, the content is all garbage. My code to write the xml file is :
    StringBuffer xml = new StringBuffer();
    xml.append(data from database);
    FileOutputStream fw = new FileOutputStream("test.xml");
    log.info("-----------System Encoding: " + System.getProperty("file.encoding") + "---------");
    OutputStreamWriter writer1 = new OutputStreamWriter(fw, "UTF-8");
    writer1.write(xml.toString());
    writer1.close();
    the log file displays System Encoding: UTF-8

  • Not able to display data in different columns using Unicode encoding

    Hi,
    Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
    Please let me know how to display data in different columns using Unicode encoding in Excel sheet.

    Hi Venkat,
    After extracting data into DSO check the request whether active or not.
    Check data in DSO in contents.
    If is there any restrictions on info providers in Queries.
    Let us know status clearly.......
    Reg
    Pra

  • Not able to display data in separate columns using Unicode encoding

    Hi,
    Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
    Please let me know how to display data in different columns using Unicode encoding in Excel sheet.
    This is an urgent need. Please help me out.

    Hi,
    I have no problem with item :P15_EV_LCL this is having a value my probem here is i am using java script to display the value in different color based on the condtion case
    eg:
    select
    case
    TRUNC((
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2)
    = :P15_EV_LCL
    then
    span style="background-color:lightgreen"
    || TRUNC((
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2) || '%' || /span
    else
    span style="background-color:yellow"
    || TRUNC(
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2) || '%' || /span
    end "Effort"
    from actuals Z
    If i dont use this <Span style="Background-color:color"> i am able to generate data in excel sheet if i use this color coding i am not able to get data in spread sheet.
    Please suggest
    Thanks
    Sudhir
    Edited by: Sudhir_N on Mar 23, 2009 10:00 PM

  • How to upload Unicode encoding files from web?

    Hi everyone,
    I do not manage to upload Unicode encoding CSV files from web. Currently I use class CL_HTMLB_MANAGER to upload file from web. It works fine with ANSI encoding files, but file content is not uploaded correctly with Unicode encoding files. Especially I get innumerable characters u201C#u201D throughout the string that contains the file content (For example instead of u201CSAP CATALOG CSV 2.0u201D I get u201CÿþS#A#P# #C#A#T#A#L#O#G# #C#S#V# #2#.#0#u201D).
    I did not find in forums a solution to my issue that is why I am now asking for your help.
    How can I upload Unicode encoding files from web? Do you know another way to upload file from web that is Unicode compatible?
    Remark: I tried to upload Unicode encoding files from SAP GUI using function module GUI_UPLOAD and upload is successful.
    Here is the code that I currently used.
    DATA:     lr_event_ex     TYPE REF TO if_htmlb_data,
               fileupload      TYPE REF TO cl_htmlb_fileupload,
               lr_upload_model TYPE REF TO /ccm/cl_bsp_upload_model,
               lr_error        TYPE REF TO /ccm/cx_file_upload.
    lr_event_ex =  cl_htmlb_manager=>get_event_ex( runtime->server->request ).
    IF lr_event_ex->event_name = 'fileUpload' AND lr_event_ex->event_type = 'upload'.
      fileupload ?= lr_event_ex.
      FREE lr_event_ex.
    * get the model
      lr_upload_model ?= me->get_model( model_id = 'mupl' ).
      IF NOT fileupload->file_name IS INITIAL.
    *   upload data
        TRY.
            CALL METHOD lr_upload_model->upload_data
              EXPORTING
                iv_file_name = fileupload->file_name
              CHANGING
                cv_xcontent  = fileupload->file_content.
          CATCH /ccm/cx_file_upload INTO lr_error.
        ENDTRY.
        FREE fileupload.
      ENDIF.
    ENDIF.
    Thank you in advance for helping me.
    Best regards,
    Vanessa

    Hi There,
    Please check the details for the same.
    Link: http://helpx.adobe.com/creative-cloud/help/sync-files.html#Sync or upload files
    Troubleshoot sync:     
    Error: "Unable to sync files"
    Creative Cloud File Sync | Known issues
    Thanks,
    Atul Saini

  • Converting String to unicode encoded string

    Hi,
    I would like to convert non-ascii characters in a String or the whole string to unicode encoded character.
    For example:
    If i have some japanese character, I would like it to be converted to /uxxxx
    How can i do this? I don't want the exact character, as I am able to get that using getBytes("encoding format"). All i want is code point representation of the non ascii unicode characters.
    Any help to do this will be appreciated.
    Thanks in advance.

    I tried to do what that but I am not sure whether that is right or not.
    String inputStr = "some non ascii string";
    char[] charArray = inputStr.toCharArray();
    int code;
    StringBuffer sb = new StringBuffer();
    for(int i = 0; i < charArray.length; i++)
    code = (int) charArray;
    String hexString = Integer.toHexString( code );
    sb.append(hexString);
    System.out.println("Code point is "+sb.toString());
    My above code does not work as expected. Could you please tell me where i am goofing?
    Thanks!

  • Can we install XI3.0 SR1 on a NON-UNICODE SAP ABAP + Java System

    Hello,
    I am trying to install XI 3.0 SR1 but i don't have an UNICODE SAP ABAP + Java System. So my question is, that is it possible to install XI on a NON-UNICODE SAP ABAP + JAVA Syatem?

    Xi 3.0 is an non unicode system, so i guess you can start installing the Xi3.0.....
    might be helpfull
    https://websmp201.sap-ag.de/unicode.
    Message was edited by:
            Nisar Khan

  • Default Unicode encoding on SAP ERP?

    Hello there! Who could help me out and tell me where I can find official SAP information about what is the default Unicode encoding if I choose to install SAP ERP Unicode system. Is it UTF-8 or UTF-16? Installer does not ask this question, it just asks you to pick "Unicode" or "Non-Unicode". How can I find out if the database will be UTF-8 or UTF-16? Tried to find documents but could not find any. Any links to any official documentation that has the answer would be greatly appreciated!

    Hi Anand,
    Seems like you failed to complete the pre-installation steps...
    As far as i can see there a Mount access failure, meaning the shares or mounts necesary for the installation are either unavailable or the user <sap>sid don't have enough rights to use it.
    Check all your pre-intallation steps (included on the installation guide available at SAP Marketplace) and try it agian.
    regards
    Juan

  • Printing unicode characters in Java - help

    Hi there,
    I want to print out unicode characters through java programming language in windows system. For example, I want to print Devanagari characters. I found out that '\u0900' to '\u0975' represent devanagari characters. So I tried following,
    out = new PrintStream(System.out, true, "UTF-8");
    out.println('\u0911');
    but they print characters like ��� and not the actual devanagari characters. Just to be more clear, devanagari script is used by Hindi, Nepali and similar languages.
    If you knew about it and could give any suggestions, that would be very helpful.
    Thanks in advance!

    priyankabhar wrote:
    I am not sure, it is just a windows system and I am trying to print to the command line. Please suggest me how I can find out if my console supports it.Use the CHCP command to find out what code page your console uses. And as already suggested, Google is a good resource if you don't know what a "code page" is.

  • Finding a Gif Encoder for Java Advanced Imaging (JAI)

    I'm trying to find the GIF encoder for Java Advanced Imaging. I keep reading all over the place that there is one, but for the life of me I can't figure out where it is supposed to be. Could anyone please enlighten me?
    Thanks

    After I installed this, it still doesn't report gif as a possible encoding type:
    String[] codecs = ImageCodec.getEncoderNames(img, null);
                for (int j = 0; j < codecs.length; j++) {
                    String codec = codecs[j];
                    System.out.println (codec);
                }only reports the following types available:
    pnm
    jpeg
    tiff
    png
    bmp

  • Help,DataInputStream and Unicode encoding problem

    Hello,everybody
    I am writing a small software for fun,but an problem about Unicode encoding stopped me. I tried to parse a file including integers,floats and Unicode characters(not UTF-8 but some other encoding type). I looked for the JDK documentation and I found that the class DataInputStream( implementing the interface DataInput) fitted my requirement best, then I tried but the Unicode characters are not read correctly( messy codes,only '????????').
    would you please help me? thanks a lot :-)

    the class DataInputStream has the methods useful to me, but find there is no method to set the encoding format ,both in DataInputStream and argument types used in its constructor:
    FileInputStream fis=new FileInputStream(fileName);
    DataInputStream     dis=new DataInputStream(fis);
    String line =dis.readLine();               System.out.println(line);
    // only "????????" output as result :-(
    I wonder how to set the encoding type,or another class.
    if I do it this way,it works,but there is no methods such as "readFloat","readInt",etc, so it's not what I want :
    FileInputStream fis=new FileInputStream(fileName);
    InputStreamReader read=new InputStreamReader(fis,"GB2312");
    BufferedReader reader=new BufferedReader(read);
    DataInputStream     dis=new DataInputStream(fis);
    String line = reader.readLine();
    System.out.println(line);
    thank you for your repley!

  • Unicode encoding

    Hi,
    We have a Non-Unicode System,Single Code Page configuration
    TCPDB: Database code pages    
    1100   SAP internal, like ISO 8859-1        (00697/00819)
    We have the processor architecture Big Endian 4102
    Oracle DB NLS_CHARACTERSET  WE8DEC
    What Unicode encoding will be using in this scenario?
    (UTF-8/CESU-8/UTF-16/UCS-2/UCS-4)?
    Regards,
    Etsg

    You can try this:
    Quit Mail, open Terminal and type:
    defaults write com.apple.mail NSPreferredMailCharset "UTF-8"
    Normally using a macron or any diacritics beyond what are in French and German should probably change you messages to UTF-8 automatically.

  • Character encoding in .java file

    If I write a file with:
    BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("MyClass.java"),"Shift_JIS"));And then compile it with:
    javac -encoding SJIS MyClass.javaand then load it into a midp application on a mobile,
    the characters in MyClass.java and in the mobile come out as & #45674;
    I am running linux from in an English Shell, would it make a difference if I set my language to be Japanese in that shell?!?
    If I save that same file manually with JEDIT (java open source word processor etc.) in SJIS -- all is happy and the code in the file is unreadable to me (because of my English system) but runs on the mobile just fine.
    Is this a bug? Limitation of Java?? Error on my part???
    TIA
    Shawn

    I suppose the font does not support the character
    '\uB26A' (a hangul syllable).Ummm, well actually I get a ? plus a real chinese character. Which is much closer than that number junk I was getting.
    So maybe I need to try to save the java file in unicode and then compile with --encoding=SJIS.
    Was that the character for immensely satisfying Korean BBQ??? Just curious.
    Shawn

  • How to prevent unicode conversion in Java?

    Hi all,
    There are some existing Chinese characters stored in our RDBMS using charset=IBMPC850. The text can correctly be displayed using a window GUI developed by Visual C++ by declaring the field as DBCS. However, when I tried to retrieve the Chinese field back using JDBC and JSP. The words are distorted. I suspect that Java converts all string to unicode and no matter what encoding I tried to change when viewing my page, I still don't get the Chinese words correctly.
    On the other hand, if I enter Chinese characters through my JSP, I can read them back correctly using:
    resultSet.getString
    Does anyone have any ideas about this?
    Your help is greatly appreciated!
    Thanks in advance.

    My guess is that you need to tell your JDBC driver which encoding to use when talking to the database server. I don't know which DBMS or driver you use so I can't help you with that. :-(
    A workaround could be to manually convert the strings after they have been retrieved from the server, using some code like this:
    String s = resultset.getString(...);
    s = new String(s.getBytes(), "Big5");
    That should do the trick if the JDBC driver reads the characters using the default (in Java) encoding, and if the database is encoded in Big5 (I don't think it's encoded in IBM code page 850 since that is an 8-bit encoding used in western Europe).
    Good luck!
    Jesper

  • String unicode - Encoding used ?

    Hi,
    Can some one please provide me information on how is it working?
    1) String uses unicode. Does it just stores unicode equivaluent or it
    uses any encoding for storing the unicode value. I have got various
    responses ranging from UTF-8 , UTF-16 to default encoding of the system.
    2) If it doesn't uses default encoding of the system then please let me know how the following works
    String x = "Some japanese character" // read from file using default encoding
    Runtime.exec("echo" + x "> file") ; //
    Who does the conversion from String 's encoding to platforms default encoding?
    If the string doesn't uses encoding and stores it as unicode equivaluent , then also who does the converstion from unicode equivalent to platform's local encoding

    http://java.sun.com/docs/books/tutorial/i18n/text/index.html

Maybe you are looking for

  • How can I delete an iCloud account off my iPhone 5 with iOS 7?

    I have an iPhone 5 that's been updated with iOS 7 and am wondering if anyone can tell me if it is possible to delete another persons iCloud account off my phone without knowing the password and only using my iPhone to do it as I don't have a computer

  • "Unable to save the raw conversion settings. There was a write permission error."

    I just built a new workstation for processing photos using PS CS5. I use external drives to store my images as I find it easier for backing up as well as for when I want use my laptop for sorting, etc.. I copied over all my old "Collection" files, an

  • Interpret Footage works fine in pre8 but NOT pre9

    I use pre8 at work - use Interpret Footage all the time to Conform to - PAL widescreen. It works fine. No problems. I have just purchased pre9 for use at home. Interpret Footage does NOT work. The video fails and the audio fails. Not good. Problem. I

  • Using input text to alter movieclip

    I have a number of movieclips which I would like to move when a particular value is entered into an input text box. The movieclips simply need to grow longer when a value is added to the input text. eg '10' would cause 'this.movieclip1._xscale += 20;

  • How can I add a blank page in Pages 5?

    No manipulation from the thumbnail window. I am so frustrated by this new downgrade! Thanks Apple for sacrificing OS X-based Pages which has only brought a mediocre application...