Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3824

Ajax request encoding case is different than non-ajax encoding

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.3.3
    • 2.3.7
    • Dispatch Filter
    • None
    • Patch

    Description

      This is related to WW-3796: Error at setting character encoding if the parameters have been already read.
      For all non-ajax requests, the default encoding is "UTF-8", defined in struts.properties: struts.i18n.encoding
      For all ajax requests, the encoding is forced to "utf-8", defined in Dispatcher.java, line 684.
      Note that the first is upper-case, the other is lower-case.
      In the applyEncoding method, the encoding is compared case sensitive, so UTF-8 and utf-8 are not equal.
      The patch changes utf-8 to UTF-8. The reference in the source comment at that line: http://www.w3.org/TR/XMLHttpRequest/#the-send-method says: "Let encoding be UTF-8."
      This way the applyEncoding method will function as one would expect.

      Attachments

        1. WW-3824.diff
          0.6 kB
          Pelladi Gabor

        Activity

          People

            lukaszlenart Lukasz Lenart
            pelladi Pelladi Gabor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: