I’m having trouble with special characters in my Tomcat projects. I have all of my files in UTF-8 with meta set for UTF-8 and still when I write łóęążźć in any form and send it by POST/GET method (I’m doing it by ajax with jQuery) I got something much more like: [|zB�D.
How can I fix it? I’m pretty sure it’s because of Tomcat (I’m using 6.0 version).
Note that jquery’s ajax() function will always transmit data with UTF-8 encoding.
In Tomcat, it’s best to set the
uRIEncodingoption of the connector toUTF-8(in server.xml). This is mainly for the encoding of the URLs but it seems to affect the encoding used with POST request (url encoded) as well: