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

解决方案 »

  1.   

    String u=new String(request.getParameter("unitid").getBytes("8859_1"));存入数据库的<%@ page content="text/html; charset=gb2312" %>页面显示
      

  2.   

    <%@ page contentType="text/html;charset=iso8859_1"%>
    <%response.setContentType("text/html;charset=iso8859_1");%><meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=GB2312">  //把数据库中取得的结果转化--显示汉字 
      public String GS(String str)
      { try
         { String temp_p=str;
           byte[] temp_t=temp_p.getBytes("GBK");
           String temp=new String(temp_t,"ISO8859_1");
           return temp;
          }
        catch(Exception e) { return "null";} 
      }  //入库前把表单中提交的中文进行转换
      public String toGB(String iso)
      { String gb=null; 
        if (iso != null)
        { try { gb=new String(iso.getBytes("ISO8859_1"),"GB2312"); } 
          catch (Exception e) { gb=null; } 
        } 
        return gb; 
      }