String CONTENT_TYPE = "text/html; charset=GB2312";
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();

解决方案 »

  1.   

    String CONTENT_TYPE = "text/html; charset=GB2312";
    response.setContentType(CONTENT_TYPE);
    request.setCharacterEncoding("GB2312");
      

  2.   

    取输入参数时要进行转换,我用的是jdk1.3.1
      

  3.   

    在设置了content_type参数后如果还有问题的话,可直接对中文的参数进行编码转换。不过一般好像永不着。
      

  4.   

    <%@ page content="text/html;charset=gb2312" %>
      

  5.   

    哦应该是这样的,刚才写错了
    <%@ page contentType="text/html;charset=gb2312" %>
      

  6.   

    str = new String(str.getBytes("iso-8859-1"));
      

  7.   

    res.setContentType("text/html:charset=gb2312");
      

  8.   

    正解response.setContentType("text/html;charset=GBK");
    request.setCharacterEncoding("GBK");