连接编码设定
或iso-8859-1 -> gb2312 or gbk

解决方案 »

  1.   

    我再文件头已经加了<%@ page contentType="text/html; charset=gb2312" %>
    现在具体怎么个转的方法?
      

  2.   

    存储的时候应该转换一下吧public String getstr(str)
    {
        String temp_p = str;
        byte[] temp_t = temp_p.bytes("ISO8859-1");
        String temp   = new String (temp_t);
        return temp;
    }catch(Exception e)
    {}
      

  3.   

    存储的时候应该转换一下吧public String getstr(str)
    {
        try{
           String temp_p = str;
           byte[] temp_t = temp_p.bytes("ISO8859-1");
           String temp   = new String (temp_t);
           return temp;
          }catch(Exception e)
          {
              System.out.println(e.toString());
          }
    return "null";
    }