发布日期:2016-02-29 11:53:42

eclipse中设置UTF-8等其他字符集。
1.windows->Preferences -> General ->Workspace,右 侧Text file encoding,选择Other,改变为UTF-8。


 2. 关闭eclipse并重新打开eclipse。 utf8文档的乱码消失。

这样设置针对整个workspace有效。

如果需要针对特定的文件类型更改字符集编码,则可以通过:
3.windows->Preferences -> General ->Web->打开,把CSS、HTML、JSP、JavaScript、XML等设置为UTF-8。
 或者:
4. windows->Preferences -> general->Content Types, 右侧Context Types树,点开Text,选择Java Source File,在下面的Default encoding 输入框中输入UTF-8,点Update,则设置Java文件编码为UTF-8。

发表评论