UTF-8 Encoding on Gets with tomcat.

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.

Comments

2 Responses to “UTF-8 Encoding on Gets with tomcat.”

  1. tOMPSON on January 29th, 2007 9:50 pm

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

  2. Ian Boston on January 29th, 2007 10:27 pm

    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.

Leave a Reply




This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 5 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a