jsp文件头加上:
<%@ page contentType="text/html; charset=GB2312" %>
<meta http-equiv="Content-type" content="text/html; charset=GB2312">
在显示内容的时候:
String record_cn = new String(rs.getString("record").getBytes("ISO-8859-1"),"GB2312");

解决方案 »

  1.   

    你说的方法我试过了,还是显示“?”,
    代码如下:
    <%@ page contentType="text/html; charSet=gb2312" %>
    <meta http-equiv="Content-type" content="text/html; charset=GB2312">
    rs = classrgq.execQuery(ls_sql);
    while(rs.next())
     {

          String sName = new String(rs.getString("Name").getBytes("ISO-8859-1"),"GB2312");
    }
      

  2.   

    如果是数据库字符集的问题,那么如何设置呢?
    我是刚刚学的jsp,有很多问题都不清楚,希望你能解释的详细一些,可以吗?万分感谢你的帮助。
      

  3.   

    http://expert.csdn.net/Expert/topic/955/955234.xml?temp=.6327631