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

           Summary: charset for "application/x-www-form-urlencoded"
           Product: Tomcat 5
           Version: 5.0.20
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Connector:HTTP
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


currently, if the browser uses "application/x-www-form-urlencoded" and the
file.encoding system parameter is on "UTF-8"
- the GET method treats it as ISO-8859-1
- the POST method interprets it as UTF-8 while

so, "field=gr%FCsse" will result in either
"grüsse" (or rather the distorted 2 characters for "ü") with GET
while with POST, you'll only get "gr." (%FC becomes a byte with value 252 that
in org.apache.tomcat.util.buf.ByteChunk.toStringInternal(), 
   strValue = new String( buff, start, end-start, enc );
gets truncated).

if I add to the connector tag in the server.xml the attribute
URIEncoding="UTF-8"  now POST and GET behave the same way (both truncating).

Enhancement suggestions:
1) align the config of GET and POST, i.e. drive the default for both by the
file.encoding System parameter or both by URIEncoding
(http://tomcat.apache.org/tomcat-5.5-doc/config/http.html)
2) allow the browser to specify the charset like for many other content types,
e.g. 'application/x-www-form-urlencoded; charset="ISO8859-1"' will also use
ISO-8859-1 even if the file.encoding is different

see also: Bug 34445, http://tomcat.apache.org/faq/connectors.html#utf8 and
bottom of http://wiki.apache.org/tomcat/Tomcat/UTF-8

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to