Results 1 to 7 of 7

Thread: Please petClinic to Chinese

  1. #1
    Join Date
    Apr 2005
    Posts
    4

    Default 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里的中文也都是??

    请求帮助....
    begin ...

  2. #2
    Join Date
    Oct 2004
    Location
    Herndon, VA, US
    Posts
    648

    Default

    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.
    --Jing Xue

  3. #3
    Join Date
    Apr 2005
    Posts
    4

    Default 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
    begin ...

  4. #4
    Join Date
    Oct 2004
    Location
    Herndon, VA, US
    Posts
    648

    Default

    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)?
    --Jing Xue

  5. #5
    Join Date
    Apr 2005
    Posts
    4

    Default 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 ??
    begin ...

  6. #6
    Join Date
    Apr 2005
    Posts
    4

    Default 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>


    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...

    and look in IE the Chinese become to ??



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

  7. #7
    Join Date
    Oct 2004
    Location
    Herndon, VA, US
    Posts
    648

    Default Re: Now,I descript the first problem in detail.

    Quote 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.
    --Jing Xue

Similar Threads

  1. Replies: 1
    Last Post: Sep 19th, 2005, 09:15 AM
  2. Chinese Characters - utf-8
    By stephenro in forum Web
    Replies: 3
    Last Post: Jul 18th, 2005, 07:21 AM
  3. Replies: 4
    Last Post: Jun 15th, 2005, 04:47 PM
  4. Chinese characters in properties file
    By stephenro in forum Web
    Replies: 2
    Last Post: Mar 30th, 2005, 08:45 AM
  5. Replies: 1
    Last Post: Oct 1st, 2004, 10:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •