Eclipse Chinese display as garbled Solution

Source: Internet
Author: User

When someone else's project or Java file is imported into their own eclipse, the Chinese comments of the Java file are often garbled, the main reason is that others' ide encoding formats are different from their own eclipse encoding formats (the default eclipse encoding method is GBK.

To sum up the suggestions and experiences on the Internet, you can refer to the following solutions:

1. Change the encoding format of the entire file type

1) eclipse-> window-> preferences-> General-> content types
2) Find the type of the file to be modified (Java, JSP, etc.), there is a default encoding below, enter GBK in the input box
3) Click Update.
4) Click OK.
5) Restart eclipse

2. Change the encoding format of the entire eclipse workspace.

1)Eclipse-> window-> preferences-> General-> Workspace-> text file encoding
2)Change the encoding format of text files

3. Change the coding format of a single project (common include GBK and UTF-8)

Right-click Project in package Explorer-> Attribute, change the encoding format of text files (commonly known as GBK and UTF-8)

4. If the above methods still cannot be solved, you can do the following:

Use editplus to open the file to be transcoded. If there is no garbled code in editplus, you can directly copy the file content to eclipse. If editplus is garbled, You can first transcode the file in editplus, editplus-> Document-> File encoding-> Change the file encoding method.-> GBK, and then use eclipse to open it.

 

 

Attachment: In my practical experience, changing the encoding method of a single project may not solve the garbled problem, but using method 2, that is, changing the encoding method of the entire workspace can solve the garbled problem. But remember to switch back to the original encoding method, otherwise it will affect other projects in the workspace.

 

From: http://zhuixue.iteye.com/blog/384340

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.