Import a Windows project to Eclipse in Linux. Since the previous project code is GBK encoded, Eclipse in Windows reads the system code by default, therefore, Eclipse in Widnwos is encoded as GBK. Ubuntu does not support GBK encoding by default. Therefore, first, we need to allow Ubuntu to support GBK. The method is as follows: first, we need to modify/var/lib/locales/supported. d. the permission of this folder imports the Windows project to Eclipse in Linux. Since the previous project code is all GBK encoded (in Windows, Eclipse reads the system code by default, therefore, Eclipse in Widnwos is encoded as GBK. Ubuntu does not support GBK encoding by default. Therefore, first, we need to allow Ubuntu to support GBK. The method is as follows:
- Modify/Var/lib/locales/supported. dThe local file in the folder cannot be modified. Run the following command to sudo chmod-R 777/var/lib/locales/supported. d.
- Modify the/var/lib/locales/supported. d/local file and add zh_CN.GBK GBKzh_CN.GB2312 GB2312 to the file.
- Sudo dpkg-reconfigure -- force localesThen, the output result contains zh_CN.GB2312 donezh_CN.GBK done as follows:
In this way, Ubuntu supports GBK encoding. Next, set eclipse,
First, select Windows-> Preferences in the eclipse menu bar, then select Workspace under General, and select Other GBK under Text file encoding. If there is no GBK option, it doesn't matter, enter three GBK letters, namely, Apply and GBK-Encoded chinese. It is no longer garbled.
Below are some of the operations in Ubuntu: