(在线等待)JSP怎么也没法正常显示中文
下面的代码我怎么做也不能正常显示,不知道是怎么回来,把设charset置成GB2312数据库中读的数据能正常显示但页的其它数据显示不正常,我把charset设置成GB18030页面是正常了,数据库中数据又不正常,我快气的不行了,各位大哥帮帮我吧
<%@ page language="java" import="java.sql.*" %>
<%@ page contentType="text/html; charset=gbk" %>
<% request.setCharacterEncoding("gbk"); %>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con;
con=DriverManager.getConnection("jdbc:odbc:zhou","","");
ResultSet rs =null;
String str="select * from sj";
Statement stmt=con.createStatement();
rs=stmt.executeQuery(str);
StringBuffer sb=new StringBuffer();
while(rs.next())
{
sb.append(rs.getString(1));
}
if(con!=null)
{
con.close();
}
%>
<html><head></head><body>
<p>zhou口若悬河</p>
<%=sb %>
</body></html>