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.
posted 11 years ago
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?
There are 10 kinds of people in this world. Those that understand binary get this tiny ad: