Leon Rosenberg wrote: > Hi, > > I have a small encoding problem, which drives me crazy... > > Our complete site is in ISO-8859-1 (which is java-default, as I understand > it). I mean, the charset of the page is ISO, and meta-tags in HTML are > telling the > browser that the page is ISO too. > Now the problem, that I have, is that I have to transmit some XML data to > another system (payment provider) which expects it in UTF-8. > The problem is that customer name can contain Umlauts (german characters: > ÃÃÃ), and they come truncated on the other side: > > Like I'm sending "Ãmlaut" and the other side gets ÃÂÂmlaut.
Well this may not be as simple as the other posts suggested. The "ÃÂÂ" string *is* UTF-8. It is the bytes EF BF BD, the UTF-8 encoded form of U+FEFF, the Unicode BOM (byte order mask), a.k.a. ZWNBSP (zero width non breaking space). This should help you see more clearly what exactly is going wrong. > I tried each conversion method I could think of sofar: > reinitializing the String as new String with reencoding: name = new > String(name.getBytes("ISO-8859-1"), "UTF-8") (in all combinations) Instead of that, try using debug messages to print your string and see if it's right. > Using URLDecoder to decode parameters. Unrelated to this problem. > Using charsetencoded Writer (OutputStreamWriter writer = new > OutputStreamWriter(outStream, "UTF-8")). > and so on... > > Can anyone give me a hint? Debug messages all the way, when you know where the problem is, you can find how to fix it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]