加上这个试试:
<%@ page contentType="text/html;charset=gb2312" %>
加上<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
不行的话:写个字符转换函数
public static String charConvert(String strSource){
if (strSource == null){
return "";
}
else{
try{
//return new String(strSource.getBytes("GB2312"), "ISO-8859-1");
String str = new String(strSource.getBytes("GB2312"), "GB2312");
System.out.println(str);
return str;
}
catch (Exception ex){
System.out.println(ex.toString());
return "";
}
}
}
<%@ page contentType="text/html;charset=gb2312" %>
加上<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
不行的话:写个字符转换函数
public static String charConvert(String strSource){
if (strSource == null){
return "";
}
else{
try{
//return new String(strSource.getBytes("GB2312"), "ISO-8859-1");
String str = new String(strSource.getBytes("GB2312"), "GB2312");
System.out.println(str);
return str;
}
catch (Exception ex){
System.out.println(ex.toString());
return "";
}
}
}
解决方案 »
- Unable to compile class for JSP找不出错误
- 文本框打印问题
- 用 | 做为分割符号不可以吗?
- 怎么样将两个ArrayList中存的值进行比较
- 在用struts的问题,请帮忙
- 在装MSSQL之前已经装了Sybase,现在连接MSSQL时就出错,而移到没有Sybase的机子上运行就正常,请问如何解决?
- jsp页中的变量怎样传给javascript
- 部署到WebLogic上后jsp网页上的flash无法显示?
- 请教问题
- 使用SpringMvc跨服务器上传图片,Ajax异步刷新图片框显示图片功能请求不到后台,onChange事件没有激活,这是为什麽?
- 我的数据库有些字段是ntext属性的,有点问题问问大家!
- 为何sqlserver数据库中ntext数据类型中字段值为中文时显示不正常?
我在别的帖里找到了解决方法,不敢独享:
下载了ms sql2000 jdbc sp1驱动,问题解决了