• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

International character

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to out put the original international string in DB "Si C�tait Hier"? now it is printed out as "Si C��tait Hier" in XML.

Thanks,
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume you output that string in an XML file that's encoded in UTF-8? Then there is nothing wrong with your XML file. What is wrong is that you are "printing it out" using some tool that doesn't realize that is encoded in UTF-8 and treats it as if it were encoded in some other encoding, perhaps ISO-8859-1 or Windows-1252 for example.
 
Steve Jiang
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The XML file has created with FileWriter(exportFile), the output just use _writer.write(ch) for each char, since we need to handle some special character like < > & | .

data is extracted from Oracle DB. The string in DB is "Si C�tait Hier"(that is what I hope to display), it was put in two XML files. If I use vi edit file, it display as "Si C��tait Hier1" in both files. But when I use IE browser to look, it display Si C�tait Hier" in one file and "Si C��tait Hier1" in another file.

Also if I do the convert with URLDecoder.decode(URLEncoder.encode(str, "UTF-8"), "UTF-8"), it could display "Si C�tait Hier" in IE browser, but still looks as "Si C��tait Hier1" with vi editor.

I am totally confused with it. Could any one give me some hints why that happens?

Thanks,

Steve
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic