Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-550

Request encoding is not correctly propagated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.3.0.CR3
    • 1.3.0.CR1
    • None
    • None

      (Related to UNDERTOW-503 and, I assume, UNDERTOW-523)

      To reiterate, XHR2 used with FormData is encoded in utf-8 and doesn't specify charset.

      Currently I'm observing this:

      1. since no charset is specified the form is parsed in iso-8859-1
      2. servletRequest.getCharacterEncoding() returns null
        • and we convert it to utf-8
      3. servletResponse is encoded in iso-8859-1
        • causing the utf-8 strings to be badly encoded

      Setting default-encoding in jboss-web.xml creates additional problems:

      1. form is parsed in default-encoding
      2. servletRequest.getCharacterEncoding() returns null
        • and now we can't tell what the encoding actually is

      Even if I could get encoding correctly the response will still be badly encoded since the initial charset isn't set - the response header is Content-Type: text/xml;charset=null. (The header charset is initially set correctly to the default-encoding but it's later overwritten, charsetSet is true but charset is null)

            sdouglas1@redhat.com Stuart Douglas
            mpetrov@redhat.com Michal Petrov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: