关于JSP中文乱码问题,我试过了很多方法了,急急急急急!
各位大侠快来帮帮忙,我都晕死了,我做的是WAP查询,用JSP语言,页面现在可以正常显示中文,如:out.print("中国");可当我从数据库中读取出来的汉字显示就是乱码,如:name=rs.getString("name");out.print("name")显示确是????号,请问这个问题怎么解决,对了系统是solarise+tomcat,而在我的WIN2000下和Tomcat下运行确显示正常,我试过各种办法:
1、String chn_string2=new String(platenumber.getBytes("ISO8859-1"),"GB2312")
2、<%@ page contentType="text/vnd.wap.wml;charset=GB2312"%>
<%request.setCharacterEncoding("GB2312");%>
3、函数转换
<%!
public String getStr(String str){
try{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e){
}
return "NULL";
}
%>
各种方法都不行,请问各位谁解决过此类问题,是不是操作系统的事,应该怎么办,我用的数据库是SQLSERVER,用JDBC连接的数据库,急!!!