Announcement Announcement Module
Collapse
No announcement yet.
Chinese Characters - utf-8 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Chinese Characters - utf-8

    I have written a web app that switches between english and chinese. If I manually insert chinese text in mysql, it appears on the page in chinese. If I enter some text into a bound input box and sumbit it, it is not being retrieved in chinese. If I look at the command object in the debugger at the onSubmit method, the field in question is in the wrong format. I can hardcode some chinese into that field and it inserts into mysql correctly.

    Anyone have any idea why the text from the jsp (i am also using tiles) is not being retrieved correctly?

    I have set encoding everywhere to utf-8. Maybe I missed something. Does the Tiles view controller need to be told to handle utf-8?

    TIA

    Steve

  • #2
    Take a look at org.springframework.web.filter.CharacterEncodingFi lter.

    HTH

    Lawrence

    Comment


    • #3
      I meet the same problem , this is my solution.

      I write my own servlet which extends org.springframework.web.servlet.DispatcherServlet, and the code is
      simple:

      import javax.servlet.http.HttpServletRequest;
      import javax.servlet.http.HttpServletResponse;

      import org.springframework.web.servlet.DispatcherServlet;

      public class MyServlet extends DispatcherServlet {
      protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
      request.setCharacterEncoding( "GBK" );
      super.doService( request , response ) ;
      }

      }
      it does work!

      Comment


      • #4
        take a look here
        http://forum.springframework.org/showthread.php?t=14063
        Last edited by robyn; May 14th, 2006, 10:47 AM.

        Comment

        Working...
        X