Today, the project under Windows is imported into the Linux eclipse, because the previous engineering code, are GBK encoded (Windows Eclipse by default will read the system encoding, so widnwos under the code of Eclipse is GBK), Ubuntu, by default, does not support GBK encoding. So, first we have to let Ubuntu support GBK, the following methods: First to modify the permissions of the/var/lib/locales/supported.d folder, or you can not modify the folder under the local files, use the following command sudo chmod-r 777/ Var/lib/locales/supported.d
Modify the/var/lib/locales/supported.d/local file to add ZH_CN to the file. GBK GBK ZH_CN. GB2312 GB2312
sudo dpkg-reconfigure--force locales then appears zh_cn in the output results. GB2312 done ZH_CN. GBK done as follows:
In this way, Ubuntu supports GBK encoding, and the following starts to set eclipse,
First select the Windows->preferences in the Eclipse menu bar, then select Workspace under General, Text file encoding Select other GBK, if there is no GBK option, it doesn't matter, Direct input GBK Three letters, Apply, GBK encoded in Chinese, is not garbled.
Here are some screenshots of the Ubuntu operation: