I have some problem with UTF-8. My client (realized in GWT) make a request to my servlet, with some parametres in the URL, as follow:
http://localhost:8080/s
It really took all day but :
final String param = new String(request.getParameter("param").getBytes(
"iso-8859-1"), "UTF-8");
See also here. Note that this is valid iff the decoding charset (URIEncoding
in tomcat) of the server is iso-8859-1
- otherwise this charset must be passed in. For an example of how to get the URIEncoding
charset from the server.xml
for Tomcat 7 see my quoted answer