Eclipse 執行時如何讓Console顯示中文、建置全UTF-8的環境、針對個別檔案類型設定預設編碼

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 console亂碼問題

原作者的資料來源已經斷了,也在這裡備份一份吧~。

- - - - - - -

原來可以直接輸入沒有顯示選項的編碼...:
Text file encoding 選 Other,
右邊 ComboBox 是可以編輯的, 自行輸入 MS950 或 Big5

 

針對個別檔案類型設定預設編碼:

Preferences=>General=>Editors=>Content Types

47264469.png

來源:Eclipse 3.1 裡的Javascript js 檔中的中文都壞掉啦

 

arrow
arrow
    文章標籤
    Eclipse IDE encoding
    全站熱搜

    Robert 發表在 痞客邦 留言(0) 人氣()