wangdd@wdd-pc:~$ gedit /var/lib/locales/supported.d/local
添加:
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
終端執行命令: 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編碼的中文, 已經不是亂碼了。