Utf8 --> GBK; GBK --> utf8
The Chinese Garbled text in eclipse is generally caused by inconsistent operating system platform encoding. For example, in Linux, the default Chinese font encoding is utf8, while in windows, the default Chinese encoding is GBK, therefore, the source code of the eclipse/myeclipse project in Linux and Windows will be garbled between different platforms, because the Chinese character encoding is inconsistent.
Solution 1:
Modify the workspace encoding format:
Window-> preferences-> General-> Workspace-> text file encoding
Solution 2:
Modify the encoding format of a single project:
Right-click the project and choose Properties From the shortcut menu ",
Select Info (the first one) in the menu tree on the left of the new window, find text file encoding on the right, select "other", and select the encoding method in the drop-down box.
Solution 3:
Modify the encoding format of a class of files:
Window --> preferences --> General --> content types --> specify an encoding type for the required file, such as GBK.
Solution 4:
Eclipse file transcoding (UTF8-GBK)-batch file transcoding tools, powerful!
Http://pan.baidu.com/share/link? Consumer id = 61340 & UK = 3204866771
Note:
1. if the project contains both utf8 and GBK coding projects, you can set different coding projects in different workspaces (swicth workspace) for separate development, there will be no confusion in encoding.
2. Native C/C ++ development of Android ndk. Java and C/C ++ must be consistent; otherwise, an error will be reported during compilation.
3. If you want to support GBK Chinese encoding in Linux (Chinese Characters in files in windows are not garbled), you need to set the encoding settings in the system. For details, you can search for them over the Internet.