You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Leon Rosenberg <st...@anotheria.net> on 2005/05/14 20:31:33 UTC

Encoding Problem ISO to UTF-8

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. 
 
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)
Using URLDecoder to decode parameters.
Using charsetencoded Writer (OutputStreamWriter writer = new
OutputStreamWriter(outStream, "UTF-8")).
and so on... 
 
Can anyone give me a hint? 
 
This problem is slowly driving me crazy.... 
 
 
regards
and thanx in advance
 
Leon