怎样解决由request.getQueryString()获得中文参数乱码问题
<a href="index?cln=RegionConsle&fld=region&ac=region_list&pn=region_index&searchword=<%=re.getName()%>"><%=re.getName() %></a>获得的是上面<a>里面的连接,但是获得值是乱码   乱码情况如下cln=RegionConsle&fld=region&ac=region_list&pn=region_index&searchword=??????

解决方案 »

  1.   

    http://www.cnblogs.com/sail/archive/2011/05/29/2061912.html
    看看这个东西能不能解释解释的!
      

  2.   

    在tomcat /conf/server.xml中
    <Connector port="8080" maxHttpHeaderSize="8192"
                   URIEncoding="utf-8"加入这个
      

  3.   


    用 java.net.URLDecoder(***, "UTF-8")   和 JAva。net.URLEcoder  都用过了 还是乱码String str = new String(request.getQueryString().getBytes("ISO-8859-1"), "utf-8"); 
    获得是繁体字乱码
      

  4.   

    转换始终不是最好的办法,保证三个utf8应该不会有乱码的问题,jsp utf8,  java utf8 , 数据库utf8,
      

  5.   

    补充一下,有时jsp页光改uft编码不行,要删除重新建一个,致于什么原因我也不明白
      

  6.   


    是的  我的jsp 和java类 都是utf-8  数据库是 oracle10g
      

  7.   

    <head>标签 里加上<meta http-equiv="content-type" content="text/html; charset=UTF-8" />试试
      

  8.   

    new String("参数".getBytes("gb2312"),"iso8859-1")
      

  9.   

    String str = new String(request.getQueryString().getBytes("ISO-8859-1"), "utf-8");  
    这个是最简单的方法  保证有用的
    不知道你是不是用  SSH2做的   如果是的话最好在  WEB。XML里加个过滤  
      

  10.   

    把这句加在最前面
    request.setCharacterEncoding("GB2312");
      

  11.   

     request.setCharacterEncoding("utf-8");