javascript与java传值乱码
javascript编码
encodeURI(cityname);
encodeURI(cityname);
javascript解码
decodeURI(cityname);
decodeURI(cityname);
java编码
URLEncoder.encode(citylist.get(i).getCityName(),"utf-8");
URLEncoder.encode(citylist.get(i).getCityName(),"utf-8");
java解码
new String(request.getParameter("cityname").getBytes("ISO-8859-1"),"UTF-8");
new String(request.getParameter("cityname").getBytes("ISO-8859-1"),"UTF-8");
hello,world~~~
![](https://files-cdn.cnblogs.com/files/thingk/%E5%BE%AE%E4%BF%A1%E6%94%B6%E6%AC%BE%E7%A0%81.bmp)