字符转码一下:public static String getReadStr(String str) {
        try {
            String temp_p = str;
            byte[] temp_t = temp_p.getBytes("ISO8859-1");
            String unicode = new String(temp_t,"GBK");
            return unicode;
        }
        catch(Exception e) {
            return "null";
        }
    }

解决方案 »

  1.   

    .jsp首行加入
    <%@page language="java" contentType="text/html; charset=GB2312"%>
      

  2.   

    public static String gbToAscii(String s)
             throws Exception
             {
                 if(s == null)
                     return "";
                 byte[] b = s.getBytes("gb2312");
                 s = new String(b, "ISO8859_1");
                 return s;
             }
      

  3.   

    得到数据后进行字符转码
     TechnoFantasy的方法是可以用的
    你在对照一下
      

  4.   

    在res.setContentType("text/html");
    改成res.setContentType("text/html;charset=gb2312");
      

  5.   

    恩 好的 我在试试 
    用了
    在res.setContentType("text/html");
    改成res.setContentType("text/html;charset=gb2312");
    就可以了 
    我在试试TechnoFantasy的方法看看。:)