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

Specify UTF-8 content type in JsonLibHandler

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.1.8.1
    • Fix Version/s: 2.3.1
    • Component/s: Plugin - REST
    • Labels:
      None
    • Environment:

      Java 5; Firefox 3.6

      Description

      Response returned by the REST plugin does not specify the character encoding. Firefox 3.6 reads the incoming JSON incorrectly for non-ANSI characters. Specifying the character encoding explicitly (;charset=utf-8) fixes the problem.

      public class JsonLibHandler implements ContentTypeHandler {
      ...
      public String getContentType()

      { return "text/javascript;charset=utf-8"; }

      ...
      }

        Attachments

          Activity

            People

            • Assignee:
              jogep Johannes Geppert
              Reporter:
              simon.legault@videotron.com Simon Legault
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: