On the website I'm trying to help with, the user can enter the URL in the browser, for example, the following Chinese characters,
http:
On the server we get
GET /a=%E6%B5%8B%E8%AF%95 HTTP/1.1
As you can see, it is encoded in UTF-8, then the URL is encoded. We can handle this correctly by setting the encoding to UTF-8 in Tomcat.
However, sometimes we get Latin1 encoding in some browsers,
http:
turns into
GET /a=%DF HTTP/1.1
In any case, is this correct to handle in Tomcat? It looks like the server should do some reasonable guesswork. We do not expect the correct processing of the Latin language 100%, but something is better than what we are doing now, assuming that all of this is UTF-8.
Tomcat 5.5 server. Supported browsers are IE 6+, Firefox 2+, and Safari on the iPhone.
java encoding tomcat internationalization servlets
ZZ Coder Aug 05 '09 at 12:55 2009-08-05 12:55
source share