[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3148) Seam URL encoding UTF-8 conflicts with Tomcat Default ISO-8859-1

Michael Youngstrom (JIRA) jira-events at lists.jboss.org
Thu Jul 3 15:26:31 EDT 2008


Seam URL encoding UTF-8 conflicts with Tomcat Default ISO-8859-1
----------------------------------------------------------------

                 Key: JBSEAM-3148
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-3148
             Project: Seam
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0.3.CR1
            Reporter: Michael Youngstrom
         Assigned To: Michael Youngstrom
             Fix For: 2.0.3.GA


I am having trouble transmitting multi-byte characters through page params.  The problem appears to be this:

1.  The servlet spec defaults URI decoding as ISO-8859-1.
2.  Calling request.setCharacterEncoding() changes this default for the body of the message (post params)
3.  In Tomcat calling request.setCharacterEncoding() does not change the encoding tomcat uses to decode the url.  In order to change the uri encoding the useBodyEncodingForURI=true must be set in tomcat configuration (http://tomcat.apache.org/tomcat-5.5-doc/config/http.html).
4. A seam redirect uses seam.core.Manager.encode() to encode request params which encodes the parameters using UTF-8.
5. So when a multi-byte character is communicated as a page param by default it gets encoded by Seam in UTF-8 and decoded by Tomcat using ISO-8859-1.

How do we fix this?  Two options:

1. Change Manager.encode() to use ISO-8859-1 instead of UTF-8 by default.
2. Make everyone who uses tomcat set useBodyEncodingForURI=true in their configuration.

I don't know if tomcat is the only container that doesn't by default URIDecode using the same content type as request.setCharacterEncoding().

I'm leaning towards option #1.  Thoughts?

Mike

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list