Eclipse Console中文乱码

来源:互联网 发布:淘宝名片设计 编辑:程序博客网 时间:2024/05/04 09:59
Eclipse主功能表-->Run-->Run Configuration-->Common 页籤-->
Console Encoding-->Others-->big5 (没有就手动输入)-->Apply
 
最后是印出正常的中文,但是这代表JDK应该是自己把它变成BIG5
所以导至设定成UTF-8的Console会印出乱码!
 
建置全UTF-8的环境:
1.在eclipse.ini的-vmargs下面加上「-Dfile.encoding=UTF-8」。
2.eclipse-->Window-->Preferences-->General-->Workspace-->Text file encoding-->UTF-8
3.Installed JREs-->Default VM Arguments:-->-Dfile.encoding=UTF-8
4.eclipse-->Run-->Run Configurations-->Arguments-->VM arguments-->-Dfile.encoding=UTF-8
5.eclipse-->Run-->Run Configuration-->Common--> Console Encoding-->Others-->UTF-8
==>乱码!
5.eclipse-->Run-->Run Configuration-->Common--> Console Encoding-->Others-->big5
==>ok!

目前发现是 JDK的问题:
a.若是用JDK1.4那console得设定成big5才行!

b.若是用JDK6,那用UTF-8就没问题!


转自:http://eggboss.iteye.com/blog/639841 (亲测有效,向原作者致敬)


原创粉丝点击