jquery ajax 请求中 中文汉字的 转码问题

1.汉字参数直接跟在请求连接的后面,这样需要使用encodeURIComponent(fileName)或者encodeURI(fileName)转码两次

后台使用URLDecoder.decode(fileName, "UTF-8");

2.如果参数发在data属性后,可以只使用encodeURIComponent(fileName)或者encodeURI(fileName)转码一次.后台使用URLDecoder.decode(fileName, "UTF-8");.

原文地址:https://www.cnblogs.com/huaxingtianxia/p/5886137.html