<%@ page contentType="text/html;charset=gb2312" %><%String name = new String(request.getParameter("name").getBytes("ISO8859_1"), "GB2312")%>不行的话,如下在JSP文件之间传递中文时,如果不能正确传递中文数据,可在web.xml文件中加入
<context-param>
<param-name>WebLogic.httpd.inputCharset./*</param-name>
<param-value>GBK</param-value>
</context-param>
<context-param>
<param-name>WebLogic.httpd.inputCharset./*</param-name>
<param-value>GBK</param-value>
</context-param>
<%@ page contentType="text/html; charset=gb2312" %>
然后在接收时进行转换
<%
String var=new String(request.getParameter("var").getBytes("ISO8859-1"));
out.println(var);
%>
开始我是在W2k下面使用tomcat3做服务器,数据库是access,可是不知道为什么,做出来的程序,在ie6里面很正常,一到ie5里面全部是乱码。好不容易在ie5里面不是乱码了,在ie6里面又成了乱码了。
后来我换成tomcat4做服务器,一下就好了。
建议改为GBK试试