Announcement Announcement Module
Collapse
No announcement yet.
Please petClinic to Chinese Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Please petClinic to Chinese

    我是初学者,刚刚配置好了spring的开源项目PetClinic,已运行正常,但碰到了中文变成乱的问 题,已断断续续在网上找了一星期的资料,均没有成功解决问题,希望能帮忙哦,衷心感谢您!!!

    我的PetClinic配置为spring+hibernate+mysql

    中文变成乱码有以下几处:
    1.页面用包含文件,包含子文件includes.jsp里<%@ page contentType="text/html; charset=UTF-8"%> 或用<%@ page contentType="text/html; charset=gb2312"%> 等,页面中文还是乱码,中文均成??
    2.中文字写进mysql数据库与读出,都是乱码,中文变成德语一样的字符
    3.messages_zh.properties里的中文也都是??

    请求帮助....

  • #2
    You might want to ask around on the Chinese Spring forum:
    http://spring.jactiongroup.net/

    Just a heads-up though, I tried to register there but didn't seem to be able to get the activation email.

    Comment


    • #3
      The Chinese become ??

      I'm sorry, I'm not good at English.
      I'm a beginner, I have successfully configured the Spring Petclinic sample application.Now I got the trouble of Petclinic in Chinese.

      My Petclinic's configuration is spring+hibernate+mysql.
      The Chinese become ??:
      1.the file includes.jsp has <%@ page contentType="text/html; charset=UTF-8"%> or <%@ page contentType="text/html; charset=gb2312"%>
      the Chinese of all pages is becomed to ??
      2.the Chinese write into Mysql---also becomed to ??
      3.the Chinese of messages_zh.properties---also becomed to ??


      Please help me...Thank you very much

      Comment


      • #4
        Sorry, haven't never seen this before. Did you try to override the browser encoding when viewing your page (e.g. in IE, View->Encoding->Chinese Simplified)?

        Comment


        • #5
          the problem is gone on...

          The default Encoding of My browser is UTF-8.
          I have overrided my browser in Chinese Simplified,but the problem still existed.
          The Chinese is still ??

          Comment


          • #6
            Now,I descript the first problem in detail.

            I create a test file(test.jsp) in two edition.
            A.the test.jsp include the "<%@ page contentType="text/html; charset=UTF-8"%>"
            the Chinese show normally.
            test.jsp

            Code:
            <%@ page contentType="text/html; charset=UTF-8"%> 
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
            <html>
              <head>
                <title>My JSP</title>
              </head>
              
              <body>
                This is my JSP page.中文<br>
              </body>
            </html>
            http://www.xhelp.cn/error3.gif

            B. the test.jsp include the file of includes.jsp
            test.jsp
            Code:
            <%@ include file="/WEB-INF/jsp/includes.jsp" %>
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
            <html>
              <head>
                <title>My JSP</title>
              </head>
              
              <body>
                This is my JSP page.中文<br>
              </body>
            </html>
            includes.jsp
            Code:
            <%@ page contentType="text/html; charset=UTF-8"%>
            when I save the test.jsp,the Eclipse will alert the encoding(ISO-8859-1) cannot convert some characters...
            http://www.xhelp.cn/error.gif
            and look in IE the Chinese become to ??
            http://www.xhelp.cn/error2.gif


            the <%@ page contentType="text/html; charset=UTF-8"%> replace to <%@ page contentType="text/html; charset=GB2312"%> the problem is same.

            Comment


            • #7
              Re: Now,I descript the first problem in detail.

              Originally posted by littlejietu
              B. the test.jsp include the file of includes.jsp
              test.jsp
              Code:
              <%@ include file="/WEB-INF/jsp/includes.jsp" %>
              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
              <html>
                <head>
                  <title>My JSP</title>
                </head>
                
                <body>
                  This is my JSP page.中文<br>
                </body>
              </html>
              includes.jsp
              Code:
              <%@ page contentType="text/html; charset=UTF-8"%>
              I have never tried to static-include a page directive before - does the contentType line in includes.jsp still get interpreted as a page directive? The result doesn't seem like it.

              Comment

              Working...
              X