UTF-8 Encoding on Gets with tomcat.

12 01 2007

Looks like browsers dont UTF encode Gets correctly, or at least that whats observed. Take a form, make it a GET and put some UTF-chars in … eg 中国的网页

Then when it gets to the server ( in this case tomcat it comes out badly coded).

If you change the GET to a POST, encoding works Ok. It could be a tomcat issue assuming the get url is something it inst or it could be something more fundamental. It looks like it happens even when the URL is URL encoded.



2 responses

29 01 2007

I just wrote an article about this topic, it should help you!

29 01 2007
Ian Boston

Yes, thank you,

setting URIEncoding=”UTF-8″ in the connector element in server.xml fixes the problem without the need to wrap the request and perform recoding.

%d bloggers like this: