MyEclipse UTF-8环境设置

来源:互联网 发布:服装画图软件x3 编辑:程序博客网 时间:2024/05/16 14:23
    为了能更好的国际化支持,能够最大程度的支持中文输出,则最好使 Java文件使用UTF-8编码。
然而,MyEclipse工作空间(Workspace)的缺省字符编码是操作系统缺省的编码,
简体中文操作系统 (Windows XP、Windows 2000简体中文)的缺省编码是GB18030,
在此工作空间中建立的工程编码是GB18030,工程中建立的java文件也是GB18030。
如果要使新建立工程、Java文件直接使UTF-8则需要做以下工作:

1、JDK 编码:

  • Window-->Preferences-->Java-->Installed JREs-->Edit JRE-->Default VM Arguments

-Dfile.encoding=UTF-8 
2、文件编码:

  • Window-->Preferences-->General-->Content Types-->Text

UTF-8

  • Window-->Preferences-->MyEclipse-->File and Editors-->JSP-->Encoding

UTF-8

  • Window-->Preferences-->General-->Editors-->Text Editors-->Spelling-->Encoding

UTF-8 
3、工作区Workspace编码:

  • Window-->Preferences-->General-->Workspace-->Text file encoding

UTF-8
4、对工程Project进行编码设置

  • 工程名右键Properties Resource-->Text file encoding

UTF-8

7、Tomcat插件设置:

  • Window -->Preferences -->MyEclipse -->Servers -->Tomcat

-->Tomcat 6.X-->JDK-->Optional Java VM Arguments
-Dfile.encoding=UTF-8

8、Tomcat服务设置

  • /tomcat/conf/server修改配置

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               URIEncoding="utf-8"/>

0 0