tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 50504] New: Allow setting query string character set trough request attribute
Date Tue, 21 Dec 2010 09:16:22 GMT

           Summary: Allow setting query string character set trough
                    request attribute
           Product: Tomcat 7
           Version: 7.0.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina

Currently tomcat is using ISO-8859-1 by default to decode query parameters.
This can be modified with connector attributes like URIEncoding and
useBodyEncodingForURI, however these are server wide settings and affect every
web application served trough that connector.

I suggest an alternative, optional way: to define query encoding with a special
request attribute. It has the benefit that it allows to use different query
parameter encoding per web application (per request). So a new application can
use UTF-8 without effecting old ones.

Jetty has a similar approach: it is using
"org.eclipse.jetty.server.Request.queryEncoding" for that (however in Jetty
UTF-8 is the default encoding for query parameters).
This is also similar to how content type charset is set for UTF-8 POST-s (using

Without this in mixed environments (where already existing applications are
served with the default settings of tomcat) new, UTF-8 based applications can
not use query parameters because browsers are using the served html page's
character set to encode query parameters (the same they are doing with POST

I am attaching a patch containing the suggested changes with a new junit test.
I named the special request attribute

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message