DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22666>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22666 Entered non us-ascii symbols into the form appead wrong in JSP ------- Additional Comments From [EMAIL PROTECTED] 2003-11-05 14:12 ------- To me this looks like you are experiencing the same problem as http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2760 ie that you can't use setCharacterEncoding() inside a JSP because Jasper has already checked the value of jsp_precompile, and the spec says you can't set the encoding after checking the value of a parameter. I'm not convinced by the solution proposed there, however. Tomcat appears to use the same character encoding for both the requested URL and POSTed parameters, which is incorrect. Specifically this code in HttpRequestBase: // Parse any parameters specified in the query string String queryString = getQueryString(); try { RequestUtil.parseParameters(results, queryString, encoding); } catch (UnsupportedEncodingException e) { ; } should be: // Parse any parameters specified in the query string String queryString = getQueryString(); try { RequestUtil.parseParameters(results, queryString, "UTF-8"); } catch (UnsupportedEncodingException e) { ; } because the servlet spec does /not/ say to use the users encoding for request URLs; it says it is to "parse POST data" (servlet 2.3 sec 4.9); and the HTTP spec says the encoding for URLs is UTF8. This problem is exacerbated for users of the portlet spec. With portlets, typical usage will have parameters in form actions (e.g. a target portlet window id) as well as in the body of POSTed forms. The form action URL is encoded on the server (should use UTF8), while the POSTed parameters sent with it use the browser's default encoding, which may not be the same. So attempting to set the encoding with a filter won't work, because the incoming request has two encodings at work. If tomcat decoded URLs differently from request bodies there would be no problem. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]