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

Michael Youngstrom (JIRA) jira-events at lists.jboss.org
Thu Nov 20 11:03:36 EST 2008

    [ https://jira.jboss.org/jira/browse/JBSEAM-3148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12439113#action_12439113 ] 

Michael Youngstrom commented on JBSEAM-3148:

Turns out that note is already in the Seam docs. :)

> Seam URL encoding UTF-8 conflicts with Tomcat Default ISO-8859-1
> ----------------------------------------------------------------
>                 Key: JBSEAM-3148
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3148
>             Project: Seam
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.3.CR1
>            Reporter: Michael Youngstrom
>            Assignee: Michael Youngstrom
>             Fix For: 2.0.3.CR2
> 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: https://jira.jboss.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list