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/10/01 14:54:35 UTC

DO NOT REPLY [Bug 31504] New: - Method GET decodes wrong, POST decodes ok

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31504>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31504

Method GET decodes wrong, POST decodes ok

           Summary: Method GET decodes wrong, POST decodes ok
           Product: Tomcat 5
           Version: 5.0.28
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: kuhn@fg.cz


If I use html form with method GET, Tomcat doesn't decode URL parameters in 
correct way. You can submit the JSP file bellow with parameter

example.jsp?input=%C5%BEena

The correct result should look like 'zena' (with accented letter 'z'), but the 
value shown is 'žena'. If you run the example with Tomcat 4.1, you would see 
the correct result.

I'm not sure which component causes this behaviour so I choose Catalina.

Tomcat versions:
4.1.x - ok

5.0.28 - KO
5.5.2 - KO

example JSP file:

<%@
 page contentType="text/html;charset=utf-8" language="java"
%><%
    request.setCharacterEncoding("utf-8");
    String value = request.getParameter("input");
    if (value == null) value = "";
%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>

<form action="#" method="get">
    <input type="text" name="input" value="<%=value%>">
    <input type="submit" value="Submit">
</form>

</body>
</html>

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