https://issues.apache.org/bugzilla/show_bug.cgi?id=50065

           Summary: Wrong handling of non-latin1 characters in HTTP
                    request parameters.
           Product: Tomcat 7
           Version: 7.0.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: aanisi...@inbox.ru


Created an attachment (id=26146)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26146)
Example app

It seems that after URL-decoding a parameter value that value is treated as a
string in some 1-byte charset, but not as a string encoded with a charset
specified by http's request character encoding.

  To reproduce, run an attached application. The start page has a link to a
test servlet and passes it a parameter that has non-latin1 characters. The test
servlet, in turn, creates two files in the current working directory into which
it prints the following two values:

 1. req.getParameter("parameter")
 2. new String(req.getParameter("parameter").getBytes("latin1"),"utf-8")

  The second file contains the actual value of the parameter, while the first
one contains some junk which looks like a result of utf-8 encoding a string
that was created by treating the original utf-8 value as a string in some
1-byte charset.

  The full source code for the test servlet is in
WEB-INF/classes/TestServlet.java.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to