`
tangzongyun
  • 浏览: 193449 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Web 乱码问题

    博客分类:
  • Java
 
阅读更多
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
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics