Eclipse工程 ubuntu 亂碼

Reason: eclipse

(Windows下的Eclipse默認會去讀取系統的編碼,因此Widnwos下的Eclipse的編碼爲GBK),而Ubuntu默認是不支持GBK編碼的。 編碼

Solution: spa

1.讓Ubuntu支持GBK
修改/var/lib/locales/supported.d/local文件,在文件中添加
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
sudo dpkg-reconfigure --force locales ip

在輸出的結果中會出現
zh_CN.GB2312 done
zh_CN.GBK done
這樣, Ubuntu就支持GBK編碼了, io

 

2.設置eclipse
Menu-> Windows->Preferences->General->Workspace.     
                  Text file encoding->Other 選擇GBK, (沒有GBK的選項的直接輸入GBK三個字符),
                                    Apply, GBK編碼的中文, Done! cli

相關文章
相關標籤/搜索