String name=request.getParameter("name");
name=new String(getBytes("8859_1"));
…………
<%=name%>

解决方案 »

  1.   

    sorry!!
    发晕了~~~~~~~~~
    name=new String(name.getBytes("8859_1"));
      

  2.   

    String name= new String(request.getParameter("name").getBytes("ISO8859-1"));
      

  3.   

    new String(name.getBytes("8859_1"));
      

  4.   

    加一句
    <%request.setCharacterEncoding("GB2312");%>传的参数最好是英文
      

  5.   

    <%@ page contentType="text/html; charset=gb2312" %>ywlx = new String(ywlx.getBytes("ISO8859_1"),"gb2312");
      

  6.   

    参考:
    1)<%@ page contentType="text/html; charset=gb2312" %>
    是你的jsp页面中最上面的语句,修改charset即可;
    2)显示传递的中文参数:
    String passname = new String(request.getParameter("name").getBytes("ISO8859_1"), "gb2312");
    System.out.println(passname);
      

  7.   

    补充:
    上面第二句写在form中或form之前都行!
      

  8.   

    String name= new String(request.getParameter("name").getBytes("ISO8859_1"));
      

  9.   

    怎么这么多人喜欢用转的方法,如果这种还出错,找我~~~~~~~~~~~
    <%@ page contentType="text/html; charset=gb2312" %>
    <%request.setCharacterEncoding("gb2312");%>
    ....
    <%=request.getParameter("name")%>