从数据库读出时用以下函数把你的数据处理一下
String trans(String chi)
{
String result = null;
byte temp [];
try
{
temp=chi.getBytes("gb2312");
result = new String(temp);
}
catch(java.io.UnsupportedEncodingException e)
{
System.out.println (e.toString());
}
return result;
}
String trans(String chi)
{
String result = null;
byte temp [];
try
{
temp=chi.getBytes("gb2312");
result = new String(temp);
}
catch(java.io.UnsupportedEncodingException e)
{
System.out.println (e.toString());
}
return result;
}
还有就是不太清楚你的代码到底是什么样的
<%@ page contentType="text/html; charset=gb2312" %>
接收变量传递时使用
String 变量名1=new String(request.getParameter("上页传递过来的变量名").getBytes("8859_1"));
格式。