標籤:c a http ext com linux
參考:http://www.linuxidc.com/Linux/2011-12/50056.htm
[email protected]:~$ gedit /var/lib/locales/supported.d/local
添加:
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
[email protected]:~$ sudo dpkg-reconfigure --force locales
Generating locales...
en_AG.UTF-8... done
en_AU.UTF-8... done
en_BW.UTF-8... done
en_CA.UTF-8... done
en_DK.UTF-8... done
en_GB.UTF-8... done
en_HK.UTF-8... done
en_IE.UTF-8... done
en_IN.UTF-8... done
en_NG.UTF-8... done
en_NZ.UTF-8... done
en_PH.UTF-8... done
en_SG.UTF-8... done
en_US.UTF-8... up-to-date
en_ZA.UTF-8... done
en_ZM.UTF-8... done
en_ZW.UTF-8... done
zh_CN.GB2312... done
zh_CN.GBK... done
Generation complete.
這樣, Ubuntu就支援GBK編碼了, 下面開始設定eclipse,
首先選擇eclipse功能表列中的Windows->Preferences, 然後選擇General下面的Workspace, Text file encoding下選擇Other GBK,如果沒有GBK的選項, 沒關係, 直接輸入GBK三個字母, Apply, GBK編碼的中文, 已經不是亂碼了。