请教高手,jsp里request.getParameter()中文乱码的解决方法
我是新手,自己用个测试页面,页面编码是GBK的 index.jsp?name=中文测试
但是name参数我用request.getParameter接收后打印出来的是乱码
在网上搜了一堆资料,也试过转换一下编码
Strinng a = request.getParameter("name");
out.println(new String(a.getBytes("ISO-8859-1"), "gbk"));
但还是不行,找了一整天的资料,都快逼疯了,求高手指点
页头
contentType="text/html; charset=gbk"
pageEncoding="gbk"
都加了,request.setCharacterEncoding("gbk") 也加了,但总是显示乱码