<%@ page contentType="text/html;charset=ISO8859_1"%>

解决方案 »

  1.   

    一:
            public static String charConvert(String strSource){
                if (strSource == null){
                    return "";
                }
                else{
                    try{
                      //return new String(strSource.getBytes("GB2312"), "ISO-8859-1");
                      String str = new String(strSource.getBytes("ISO-8859-1"), "GB2312");
                      System.out.println(str);
                      return str;
                    }
                    catch (Exception ex){
                      System.out.println(ex.toString());
                      return "";
                    }
                }
            }二:
    request.setCharacterEncoding("gb2312");附加:
    我认为比较怪异,不知道为什么,我好象基本上就没有遇到过乱码问题似的。
    在我的jsp页面上,我同时使用了
    <%@ page contentType="text/html;  charset=gb2312"%>

    <%  request.setCharacterEncoding("gb2312");%>
    结果我从来就没有碰到过乱码问题。
    我狂晕~!
      

  2.   

    可能跟JSP开发环境有关吧,我是APACHE+TOMCAT+POSTGRESQL环境下,现在中文问题还没解决,各位有没有和我一样的环境,说说解决办法
      

  3.   

    我用的Apache Tomcat 5.0.12般+jdk1.4.05
    没有看过中文乱码!!
    建议你升级
    <%@ page contentType="text/html;  charset=gb2312"%>

    <%  request.setCharacterEncoding("gb2312");%>
      

  4.   

    不知道是你弄错了还是^^^^^^^
    <%@ page contentType = "text/html;charset=gb2312" %>
    应该这样写!     注意空格
      

  5.   

    非常感谢CAINA的strSource.getBytes("ISO-8859-1"), "GB2312"
    但是你的核心代码仍然是GETBYTES,我已经说过这种方式不好用
    至于<%  request.setCharacterEncoding("gb2312");%>我没有用过,因为提示编译不能通过。
    请高手认真考虑一下我的XP环境和记事本工具是否妥当,
    另外我要求的不是SYSTEM.OUT,而是直接OUT到网页上,我的SYSTEM.OUT本来就没有问题。
      

  6.   

    干吗不用resin,jsp不会有中文问题的