JS Chinese Conversion (UTF-8), url transfer Chinese garbled solve

When js synthesis url, if the parameter is Chinese, will be garbled struts2 reached, the solution is as follows:
1.js file using encodeURI () method (must be two sets).
= the encodeURI login_name (the encodeURI (login_name));  
2.action in URLDecoder decoding
loginName = java.net.URLDecoder.decode (loginName, "UTF  -8");

Reproduced in: https: //my.oschina.net/u/2552902/blog/543841

Guess you like

Origin blog.csdn.net/weixin_34366546/article/details/92326987