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

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

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

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

posted @ 2016-09-19 18:08  华行天下  阅读(5183)  评论(0编辑  收藏  举报