public String gbTo(String s)
    {
        String s1 = null;
        try
        {
            s1 = new String(s.getBytes("GB2312"), "8859_1");
        }
        catch(Exception exception) { }
        return s1;
    }

解决方案 »

  1.   

    public String gbTo(String s)
        {
            String s1 = null;
            try
            {
                s1 = new String(s.getBytes("8859_1"), "GB2312");
            }
            catch(Exception exception) { }
            return s1;
        }
      

  2.   

    <%@ page contentType="text/html; charset=gb2312"%>
    在jsp页面加上这个。你搜一下啊,很多这样的问题。
      

  3.   

    一般是楼上所说的那句没加
    还有涉及倒与数据库或bean传值时需要使用
    str = new String(str.getBytes("8859_1"))