Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Encoding problem (Umlaute) in HTTP-Headers

843842Mar 25 2008 — edited Mar 29 2008
Hi!

I have a servlet that is being called by another server via a POST request.
The request contains user data in HTTP-headers, and whenever there is a
German Umlaut in the user's name, it ends up garbled. :(

The requests character encoding is set to 'ISO-8859-1', according to the servlet
requests getCharacterEncoding() method.

I try to copy the value of a header variable into a String like this:
headerNameValue = request.getHeader("headerNameKey");
Which, unfortunatly, doesn't work. For example, the value "G�nter" becomes "G����nter".

Shouldn't the API take care of the encoding, when the CharacterEncoding is set
right in the servlet call?
It looks like it interprets the ISO88591 data as Unicode?

BTW, I'm on a WebSphere 5 server, with Java 1.4.

I've been tearing my hair out on this one for days, so any help is highly appreciated.

Thanks a lot!
Andreas
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 26 2008
Added on Mar 25 2008
14 comments
1,696 views