http://www2.ccw.com.cn/02/0224/c/0224c05_4.asp

解决方案 »

  1.   

    String str=new String((request.getParameter("name")).getBytes("ISO8859-1"),"gb2312")%
    insert into tb_student values ('"+str +"',.........);
      

  2.   

    <%@ page contentType="text/html; charSet=GBK" %>
    加入即可
      

  3.   

    用楼上的楼上的东西或者用个中文处理函数public String getStr(String str){
    try{
    String temp_p=str;
    byte[] temp_t=temp_p.getBytes("ISO8859-1");
    String temp=new String(temp_t);
    return temp;
    }catch(Exception e){}
    return "null";
    }
      

  4.   

    上边怎么实现方法都写了,我要说的是你把这种方法在插入数据库前调用一次,保证是ISO-8859-1,调出来再转换一次,变为GB2312.
    搜索相同的问题,为什么大家都不用搜索??
      

  5.   

    需要文字编码转换
    你可以在没有往数据库中添加之前在页面中print出来看看是不是乱码
    试一试这个函数
    public String getChinese(String str){
    try{
    String str1=str;
    byte[] str2=str1.getBytes("ISO8859-1");
                String temp=str2.toString();
    return temp;
    }
    catch(Exception e)
    {
    }
    return "Null";
    }