wanggaofu 发表于 2008-4-10 11:45

TOMCAT不显示汉字

我的TOMCAT是网络上下载的5。5压缩把版本。  
可以显示我的JSP文件。 但是不显示文件里的汉字。。。。数字和英文都可以。
这是什么问题啊
新手问题

Ethip 发表于 2008-4-10 12:25

回复 1# 的帖子

<%@ page contentType="text/html;charset=gb2312"%>
不要用iso...

酒浪子 发表于 2008-4-12 16:58

将charset全部换成UTF-8

sz_lee820 发表于 2008-4-12 17:08

public static String toChinese(String strvalue) {
    try {
      if (strvalue == null || strvalue == "") {
        return null;
      }
      else {
        strvalue = new String(strvalue.getBytes("ISO8859_1"), "GBK");
        return strvalue;
      }
    }
    catch (Exception e) {
      return null;
    }
  }

页: [1]

编程论坛