tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramez Ghazzaoui <>
Subject Re: request.getParameter() in JSP misinterpreting foreign characters
Date Tue, 20 Feb 2007 03:56:40 GMT
Thank you guys. Sounds like I need to either write or find a method that 
converts strings to UTF-8. I'll try this tomorrow.

BTW I am not using HTML forms, just building URIs dynamically and 
sticking them into <a href=...> anchors. That's where the GET part comes 
into play :)



Markus Schönhaber wrote:
> Ramez Ghazzaoui wrote:
>> Today I realized that this very solution has broken the Java
>> request.getParameter() method in JSP. Now, with the URIEncoding set to
>> UTF-8, this Java method is misinterpreting non-English characters. When
>> I invoke from the browser the following address:
>> http://localhost/main.jsp?path=olé (or the equivalent
>> http://localhost/main.jsp?path=ol%E9) a call to
>> request.getParameter("path") from within main.jsp returns ol? where the
>> question mark is character number 65533. That's way off from 233 (which
>> is the correct U-dec for eacute, or é).
> If you tell Tomcat that you'll provide URIs which are encoded in UTF-8 then do 
> as you said and provide UTF-8-encoded URIs. Your example above should 
> therefore look like
> http://localhost/main.jsp?path=ol%C3%A9
> If you're using HTML-forms with method="GET", set the accept-charset attribute of the
form to UTF-8.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message