我用的是j2sdk 和jswdk组成的环境

解决方案 »

  1.   

    <%
    request.setCharacterEncoding("GBK");
    %>
      

  2.   

    public String toChinese(String str)
      {
        String temp ="";
        if(str == null || str.trim().equals(""))
          return temp;
        try{
          temp= new String(str.getBytes("8859_1"),"GB2312");
          }catch(Exception ex)
          {
            ex.printStackTrace();
          }
          return temp;
      }
      

  3.   

    <%@ page contentType="text/html;charset=GBK" %>
      

  4.   

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