你是用什么编译的?如果是jb,改变project->compiler->encoding 为ISO8859_1,
如果直接用jdk,编译是加入参数-encoding ISO8859_1.如果你不明白的话,就把你的机器区域设置为usa,编译.

解决方案 »

  1.   

    将 out 定义为:PrintWriter
    如:PrintWriter out = res.getWriter();
      

  2.   

    试试看将得到的字符串字符集转换
    public static String unicodeToGB(String strIn){
    byte[] b;
    String strOut = null;
    if(strIn == null || (strIn.trim()).equals(""))
    return strIn;
    try{
    b = strIn.getBytes("GBK");
    strOut = new String(b,"ISO8859_1");
    }catch(UnsupportedEncodingException e){}
    return strOut;
    } public static String GBToUnicode(String strIn){
        String strOut = null;
    if(strIn == null || (strIn.trim()).equals(""))return strIn;
             try{
                 byte[] b = strIn.getBytes("ISO8859_1");
                 strOut = new String(b,"GBK");
             }catch(Exception e){}
            return strOut;
    }
      

  3.   

    在jsp文件头上加上
    <%@ page contentType="text/html;charset=gb2312" %>