URL 乱码
String str = URLEncoder.encode("你好", "UTF-8");
System.out.println(str);
str = URLDecoder.decode(str, "UTF-8");
System.out.println(str);
TOMCAT默认ISO-8859-1 因此可以设置默认编码为UTF-8解决,
在conf\server.xml文件中设置如下
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
http://blog.csdn.net/xiazdong/article/details/7217022
http://blog.sina.com.cn/s/blog_ad1c3bdf0102uz99.html
Web 乱码问题
猜你喜欢
转载自tangzongyun.iteye.com/blog/2293762
今日推荐
周排行