Mac OS X - Tomcat 乱码问题

  1. Myeclipse 启动Tomcat 控制台乱码:
    window -> Preference -> myeclipse -> servers -> tomcat -> tomcat7.0 -> JDK -> optional java VM arguments :加入 -Dfile.encoding=GBK
  2. 接受数据乱码,设置字符集什么都不管用时:
    修改Tomcat的server.xml
1
2
3
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"/>
1
2
3
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8" />
Gavin Liu wechat
欢迎您扫一扫上面的二维码,订阅我的微信公众号!