英文操作系统 Myeclipse Console 乱码问题
文章1:
安装了Myeclipse 9之后,web应用程序,tomcat控制台乱码
按照网上的方法
1.Windows->Preferences->general->Workspace->Text file encoding->Other框中的Text file encoding改为UTF-8。
2.Windows->Preferences->General->Editors->TextEditors->Spelling Encoding 改为UTF-8
3.Servers窗口中,tomcat服务器右击->runconfiguration->common->encoding 设置为UTF-8
全都设置了之后,consolen中的中文依旧显示为“??????”
折腾了好久都没有得到解决。
后来考虑到,我的操作系统是英文版的,猜想与操作系统有关,在网上搜索之后终于找到了。
打开Control Panel->Clock,Language,and Region->Region and Language->Format选项卡,Format选择相应的语言,之后重启myeclipse就好了。
文章2:
這真是個很討厭的問題
當我所有的設定都設成UTF-8的時候
偏偏console怎麼搞都是亂碼
後來才發現當java檔編碼設為BIG5時就正常了…
這不是我要的!
再後來發現這篇
Eclipse 執行時如何讓Console顯示中文
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就沒問題!
eclipse.ini的-vmargs下面加上「-Dfile.encoding=UTF-8」eclipse 的默认编码,当设置英文操作系统的语言环境为中文简体是,其默认为GBK
如果英文操作系统没有设置语言环境为中文简体则其默认为Cp1252