get请求参数特殊字符及中文乱码处理
1.前端处理
1.1特殊字符编码
对请求参数使用
var strCode=encodeURIComponent(str)
1.2中文乱码编码
var content=encodeURI(strCode)
1.3url中拼接参数
2.后台处理
string requestParam=URLDecoder.decode(content)
2021-05-13
最新推荐文章于 2022-04-14 08:29:51 发布
get请求参数特殊字符及中文乱码处理
1.前端处理
1.1特殊字符编码
对请求参数使用
var strCode=encodeURIComponent(str)
1.2中文乱码编码
var content=encodeURI(strCode)
1.3url中拼接参数
2.后台处理
string requestParam=URLDecoder.decode(content)