网上太多资料了,试了多个。这个终于解决了。记录下
var url = encodeURI(encodeURI(url)); //要encode2次,在后台也不能直接获取,要用
String param = URLDecoder.decode(req.getParameter("param"),"UTF-8");
最后发现是大意写错了$.ajax() post请求 没写 date 参数,导致变成了get请求才出现了这个乱码。
网上太多资料了,试了多个。这个终于解决了。记录下
var url = encodeURI(encodeURI(url)); //要encode2次,在后台也不能直接获取,要用
String param = URLDecoder.decode(req.getParameter("param"),"UTF-8");
最后发现是大意写错了$.ajax() post请求 没写 date 参数,导致变成了get请求才出现了这个乱码。
转载于:https://my.oschina.net/CashWong/blog/543402