<%@ page contentType="text/html; charset=gb2312" language="java"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body></body>
</html>我曾经和你有过一样的问题,试试这个。<%@ page contentType="text/html; charset=gb2312" language="java"%> 这句最重要。
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body></body>
</html>我曾经和你有过一样的问题,试试这个。<%@ page contentType="text/html; charset=gb2312" language="java"%> 这句最重要。
那么一般来说他的编码方式是ISO-8859-1
那么你需要一次转码
String s = rs.getString(1);
s = new String(s.getBytes("ISO-8859-1"), "GB2312");
页面需要加中文的转码
<%@page content="text/html; charset=gbk"%>
String s = rs.getString(1);
s = new String(s.getBytes("ISO-8859-1"), "GB2312");我有 我自己定义了一个中文处理方法~其它页面就没问题哦~ 就是这个页面`你有些部份中文显示正常`有些部分就是乱码~! 这才麻烦`! 不知道哪里的问题`~
<%@ page contentType="text/html; charset=gb2312" language="java"%>
都不一定能行. 连<meta http-equiv="Content-Type" content="text/html; charset=gb2312">也加了