Hi,
I'm having a problem with HttpServletRequest.setCharacterEncoding("UTF-8").
Basically, tomcat seems to ignore it completely, and assume "latin1" encoding.
Here's the details:
- I have an html < form > where user should type data in *Chinese*.
- The browser (IE6) knows that the form data should be sent to the server,
encoded as UTF-8 ( this encoding is mentioned in my "content-type" as well as
in < from accept-charset="UTF-8" > ).
- I can actually see that the browser sends the data correctly (this is a
GET, so I can see the encoding)...
- On the servlet size, I write:
request.setCharacterEncoding("UTF-8");
String p=request.getParameter("name");
Unfortunatelly, this simply doesn't work. Tomcat reads the parameters as if
they were "latin1" ... I can extract them by forcefully converting back to
utf-8, but it's ugly and not portable...
I know you can configure tomcat's < Connector > to use utf-8, but I really
don't want to do it ( client has a standard Tomcat installation, and I'm
absolutely not allowed to touch it).
Is there any reason why tomcat would ignore my "request.setCharacterEncoding"
?
Am I doing something wrong, or is Tomcat just ignoring the j2ee spec in this
point ?
Thanks
---------------------------------
Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.