加<%@ page contentType="text/html;charset=GBK"%>
或response.setContentType("text/html;charset=GBK");

解决方案 »

  1.   

    我在页面里已经添加了<%@ page contentType="text/html;charset=GB2312"%>。也不好用。
      

  2.   

    你还需要自己设置编码格式
    <%request.setCharactorEncoding("GBK");%>这样的设置和你页面上自定义的charset=“gb2312”是不一样的!
      

  3.   

    %@page contentType="text/html;charset=GBK"%> 这句话放到第一行。
      

  4.   

    public class Convert {
      public static String convert(String string) {
        String s = "";
        try {
          s = new String(string.getBytes("iso-8859-1"), "GBK");
        }
        catch (Exception ex) {
          System.out.println("字符串处理异常");
        }
        return s;
      }
    }
    直接调用着个static方法就可以解决
      

  5.   

    页面多加一句<meta http-equiv="Content-Type" content="text/html; charset=gb2312">