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");
<%@ 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");
代码如下:
<%@ 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");
}
我是刚刚学的jsp,有很多问题都不清楚,希望你能解释的详细一些,可以吗?万分感谢你的帮助。