转自:https://blog.youkuaiyun.com/wuziqiangqiang/article/details/50986851
第一种方式:
js使用encodeURIComponent()方法进行编码,例如:
var url = encodeURIComponent(encodeURIComponent(url));
java后台使用URLDecoder.decode();方法来解析。
为什么要使用两次这个方法呢?
有待研究
第二种方式:
js使用encodeURIComponent()方法进行编码,例如:
var url = encodeURIComponent(str);
java后台使用new String(str.getBytes(“iso-8859-1”),”utf-8”);