js的url乱码解决

1.客户端:
url=encodeURI(url);
服务器:
String linename = new String(request.getParameter("name").getBytes("ISO-8859-1"),"UTF-8");

2.客户端:
url=encodeURI(encodeURI(url)); //用了2次encodeURI
服务器:
String linename = request.getParameter(name);
//java  : 字符解码
linename = java.net.URLDecoder.decode(linename , "UTF-8");

你可能感兴趣的:(String,服务器,url)