GET方法URL中传递中文参数乱码的解决方法

来源:互联网 发布:魔兽世界5m掉落数据库 编辑:程序博客网 时间:2024/04/27 20:22
1.在页面中对你的URL进行编码

使用------encodeURI(你要使用的中文参数值)如:...?username"+encodeURI(“小甜甜")

2.在后台通过解码来接收该中文参数

使用----String name = new String(request.getParameter("username ").getBytes("iso8859-1"),"utf-8")