前台传中文到后台乱码解决

//如果你使用的是tomcat服务器,记得首先要在conf/server.xml
   //中加上URLEncoding="utf-8",否则你在界面上再怎么折腾编码,后台得到的中文数据还是乱码
①<Connector URIEncoding="utf-8" connectionTimeout="20000" port="8080" 
protocol="HTTP/1.1" redirectPort="8443"/>
      ②将传输的数据进行:encodeURI(urlParam);编码

猜你喜欢

转载自geertu.iteye.com/blog/2372830