Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-3148

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

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0.3.CR1
    • Fix Version/s: 2.0.3.CR2
    • Component/s: Core
    • Labels:
      None

      Description

      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  youngm youngm
                  Reporter:
                  youngm youngm
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: