【Linux/Ubuntu学习 10】unbuntu 下 eclipse 中文乱码的解决
wangdd@wdd-pc:~$ gedit /var/lib/locales/supported.d/local
添加:
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编码的中文,
已经不是乱码了。