UTF GET parameter codification problem in JSP (JBoss 2.0.1)

Posted by GreyMen on Stack Overflow See other posts from Stack Overflow or by GreyMen
Published on 2010-04-26T16:00:31Z Indexed on 2010/04/26 16:03 UTC
Read the original article Hit count: 323

Filed under:
|
|
|
|

I´m trying to take a string from a GET or POST parameter in JSP with some accents in UTF-8:

<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <% request.setCharacterEncoding("UTF-8"); String value = request.getParameter("q"); out.print(value+" | aáa"); %>

The codification of the hardcoded string is correct but the codification of the value obtrained from the parameter (example: http://whatever/utf.jsp?q=a%E9a) it´s wrong...

I have already modify the the server.xml dropping the URIEnconding UTF-8... So I don´t now what I have to do to show the data in the correct format...

Any idea?

© Stack Overflow or respective owner

Related posts about jsp

Related posts about encoding