String s=request.getParameter("a");
String ss=new String(s.getBytes("ISO8859-1"),"GBK");我这样处理传过来的中文 为什么还显示的是?号呢

解决方案 »

  1.   

    页面最上面加一行<%@ page contentType="text/html; charset=gb2312"  %>就好了,String ss=new String(s.getBytes("ISO8859-1"),"GBK");就不用要了,这里不需要转
      

  2.   

    aaa 呵呵哈哈 
    aaaa ??a?? 这是结果
      

  3.   

    <%@   page   contentType="text/html;charset=gb2312"%><% String s=request.getParameter("a");%>
    <%=s%>这是接收页面
      

  4.   

    String ss=request.getParameter("a");
    String ss=new String(s.getBytes("ISO-8859-1"),"gb2312");
      

  5.   

    String s=request.getParameter("a");
    String ss=new String(s.getBytes("ISO-8859-1"),"GB2312");
      

  6.   

    结果:aaa 呵呵哈哈
    aaaa ??a?? 
    说明能显示出中文啊,那显然不是编码的问题。需要知道String s=request.getParameter("a");里的a所在的上一页面的情况,肯定是那里的问题
      

  7.   

    <%@ page contentType="text/html; charset=gb2312"  %><%@ include file="aaa.txt" %>呵呵哈哈
    <br>
    <jsp:include page="include/aaa.txt" /><jsp:include page="include/tom.jsp">
    <jsp:param name="a" value="呵呵a哈哈" />
    </jsp:include>