You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/01/07 17:08:14 UTC

DO NOT REPLY [Bug 25958] New: - Request.setCharacterEncoding doesn't work properly if you send form via get method and if you go to another page via link

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=25958>.
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=25958

Request.setCharacterEncoding doesn't work properly if you send form via get method and if you go to another page via link

           Summary: Request.setCharacterEncoding doesn't work properly if
                    you send form via get method and if you go to another
                    page via link
           Product: Tomcat 5
           Version: 5.0.16
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Servlet & JSP API
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: ondra@matfyz.cz


We have webapp using encoding UTF-8 for all pages. It is set in jsp header and 
in meta tag in header. We use filter wrapping the whole application and setting 
request.setCharacterEncoding("UTF-8"); When we send data from FORM via POST 
method, everything is OK, but if we change method to GET, data is badly encoded. 
We tested it with characters from iso-8859-2 and iso-8859-5 codepage. For 
example, czech characters čžščž are encoded as %c4%8d%c5%be%c5%a1%c4%8d%c5%be, 
it looks like well urlencoded UTF data, and when we sniffed data posted via POST 
method, it was the same. This problem occures if you use such data in parameters 
of link too. We post this problem to our local java mailing list and a few 
people confirmed the same behavior, so it looks it is not only our problem.

Used configuration:

Clients: Win IE 6.0, Mozilla 1.4, Opera 7.21
Server OS: Windows 2000, Linux
Container: Tomcat 5.0.16
Java: J2SDK 1.4.2_03

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: DO NOT REPLY [Bug 25958] New: - Request.setCharacterEncoding doesn't work properly if you send form via get method and if you go to another page via link

Posted by Jess Holle <je...@ptc.com>.
Note that Sun suggests use setCharacterEncoding() for exactly this 
purpose in their new "how-to" article at 
http://java.sun.com/developer/technicalArticles/Intl/MultilingualJSP/.

Amongst other things they say (under the heading "Handling Request 
Parameter Encodings" and after having described 
request.setCharacterEncoding()):

    "If the application always sends pages in UTF-8, it can simply
    specify this encoding as the request encoding."

So Sun is clearly messaging that this is a good, standard means for 
web-app developers to address the problem.

I'd suggest that the out-of-the-box default settings be for the 
suggested Sun techniques to work...

--
Jess Holle