Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Export UTF-8 characters failed

    Hello,

    the export of listgrid datas with UTF-8 characters failed.
    The data export is a HTTP-Post an the export data are UTF-8 encoded, but the contentType for this POST is "application/x-www-form-urlencoded". (See exportheader.jpg)

    CRUD operation use als the POST command, but the contentType is "application/x-www-form-urlencoded; charset=UTF-8". (See fetchheader.jpg)

    Same problem for custom operations. For example a custom pdf export as you describe in your documantation.

    We use SmartGWTPro 3.0 2012.02.15 and tomcat 6.
    In the debug mode with jetty it works correct. I think, jetty has UTF-8 as default for POST commands.

    Regards

    Peter
    Attached Files

    #2
    Take a look at the Internationalization topic in the docs. As it says, use *all* of the approaches for setting charset to get the best compatibility with different Servlet engines.

    Comment


      #3
      Hello,

      I have read the documentation and I found this part:

      "NOTE: Default Encoding

      As mentioned above, Isomorphic recommends the use of UTF-8 encoding. However, it is not possible to configure some servlet engines to do this by default. Both Tomcat and Jetty default to the ISO-8859-1 character set (commonly known as Latin-1), even if the Java VM specifies a different encoding (the Tomcat documentation claims that this behavior is a requirement of the Servlet specification).

      To work around this, we change charset encoding to UTF-8 on every request/response that goes through two core Isomorphic servlets: IDACall and DataSourceLoader. If you need to change this, you can do so by adding init-param settings to your web.xml file. Please see the Javadocs for those two servlets for examples of how to do this."

      But as you see in the attached jpgs, the export is an IDACall without setting the charset to UTF-8.

      Peter

      Comment


        #4
        We set the charset *on the response*. You've gone a *request* with the wrong charset, this is affected by the techniques mentioned earlier in the document (<meta> tag, charset header, etc).

        Comment


          #5
          I have solve the problem by setting the character encoding in a servlet filter.

          Look here http://wiki.apache.org/tomcat/FAQ/CharacterEncoding

          Comment

          Working...
          X