Eclipse garbled solution Summary (utf8-GBK)

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.