Stringname = new String(Stringname.getBytes("8859_1"),"gb2312")
请试一试,如果不对,请见谅,因为我也是个新手

解决方案 »

  1.   

    常用字符集: GBK,GB2312, UTF-6, ISO-8859-1  转换用户输入信息字符集
    request.setCharacterEncoding(“UTF-8”);
    request.getParameter("value").getBytes("8859_1"),"gb2312");
     转换输出信息字符集
    new String(str.getBytes("GB2312"),"ISO-8859-1");
    new String(str.getBytes(" ISO-8859-1 "),“GBK");
    request.setCharacterEncoding("UTF-8"); 
     读取数据库数据
    str=new String(str.getBytes("GB2312"));
     插入数据库数据
    str=new String(str.getBytes("ISO-8859-1"));
      

  2.   

    就两句话,试试看
    <%
    response.setContentType("text/html;charset=gb2312");
    request.setCharacterEncoding("gb2312");
    %>