windows下的工程導入到了Linux下eclipse中,由於以前的工程代碼,都是GBK編碼的,而Ubuntu默認是不支持GBK編碼的。所以,首先我們要先讓Ubuntu支持GBK,方法如下:
-
修改/var/lib/locales/supported.d/local文件,在文件中添加zh_CN.GBK GBKzh_CN.GB2312 GB2312
-
sudo dpkg-reconfigure --force locales然後在輸出的結果中會出現zh_CN.GB2312 donezh_CN.GBK done
這樣, Ubuntu就支持GBK編碼了, 下面設置eclipse。
首先Windows->Preferences, 然後選擇General下面的Workspace. Text file encoding選擇Other GBK, 如果沒有GBK的選項, 沒關係, 直接輸入GBK三個字母, Apply, GBK編碼的中文, 已經不是亂碼了。
Persist in the end and
Never give up
文章摘自:http://ithinkfeed.iteye.com/blog/1334926