The project under Windows was imported into Linux under Eclipse, because the previous engineering code is GBK encoded (Eclipse under Windows defaults to read the encoding of the system, so Widnwos's code for Eclipse is GBK), Ubuntu, by default, does not support GBK encoding. So, first we have to let Ubuntu support GBK, the method is as follows:
- First of all to modify the permissions of this folder/var/lib/locales/supported.d, or you can not modify the folder under the local file, 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 GBKZH_CN. GB2312 GB2312
- sudo dpkg-reconfigure--force locales then appears zh_cn in the output results. GB2312 DONEZH_CN. GBK done is as follows:
In this way, Ubuntu supports GBK encoding, and the following begins to set up Eclipse,
First select Windows->preferences in the Eclipse menu bar, then select Workspace under General, Text file encoding under other GBK, if there is no GBK option, it's okay, Direct input GBK Three letters, Apply, GBK encoded in Chinese, is no longer garbled.
Ubuntu under Eclipse add GBK encoding