<%@ 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>

解决方案 »

  1.   

    在接收页面加上
    <%@ page contentType="text/html; charset=gb2312" %>
    然后在接收时进行转换
    <% 
    String var=new String(request.getParameter("var").getBytes("ISO8859-1"));
    out.println(var);
    %>
      

  2.   

    把GB2312换成UTF-8试试,传送页面和接收处的编码方式都是UTF-8
      

  3.   

    我也曾经遇到过类似的情况,到现在也不是很明白为什么会这样。
    开始我是在W2k下面使用tomcat3做服务器,数据库是access,可是不知道为什么,做出来的程序,在ie6里面很正常,一到ie5里面全部是乱码。好不容易在ie5里面不是乱码了,在ie6里面又成了乱码了。
    后来我换成tomcat4做服务器,一下就好了。
      

  4.   

    如果你用的是jsp的话,是一下这个命令request.setCharastEncoding("GBK");
      

  5.   

    Resin服务器在这方面做得很不错,可以试试:http://www.caucho.com
      

  6.   

    如果是个别字出错
    建议改为GBK试试