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

           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
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: kiralyattila...@gmail.com


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
request.setCharacterEncoding()).

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
bodies).

I am attaching a patch containing the suggested changes with a new junit test.
I named the special request attribute
"org.apache.tomcat.request.query_encoding".

-- 
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