Results 1 to 2 of 2
  1. #1
    ajay.madamala is offline Member
    Join Date
    Apr 2009
    Posts
    2
    Rep Power
    0

    Default Problem when reading non ascii chars

    Hi All

    I have a requirement here when an XML message is being parsed. Due to some additional enhancement to output XML I went to write a java custom code to add new tags to existing XML. However, as XML message consists of non ascii chars, when entire xml doc read as string, java internal conversions are happening from non ascii to ascii.. this results as some new char(non- ascii) apprearing in target XML. Can any one help me how can I make sure non ascii chars will pass as it is...

    Source of XML looks like
    <CANDTOWNCITY>Düsseldorf</CANDTOWNCITY>

    after parsing it comes as <CANDTOWNCITY>Düsseldorf</CANDTOWNCITY>

    my requirement is : data should come as <CANDTOWNCITY>Düsseldorf</CANDTOWNCITY>

    Thanks

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Java should work in Unicode internally. Java Strings are Unicode strings. Have you checked the documentation for the methods you are using and that you haven't set the locale no be non-Unicode or something?
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

Similar Threads

  1. Replacing the chars within a string.
    By Mayur in forum New To Java
    Replies: 2
    Last Post: 03-27-2009, 05:00 AM
  2. chars
    By whosadork in forum New To Java
    Replies: 6
    Last Post: 10-03-2008, 10:40 PM
  3. writting extended ascii chars on socket........or Endianness Issue......??
    By sachinj13 in forum Threads and Synchronization
    Replies: 8
    Last Post: 09-23-2008, 03:20 PM
  4. Reading ASCII / Unicode character in Java
    By NGRaju in forum New To Java
    Replies: 2
    Last Post: 09-16-2008, 11:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •