Eclipse Chinese display as garbled Solution
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-> contenttypes
2)Find the type of the file to be modified (Java, JSP, etc.), there is a defaultencoding 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-> textfile 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 no garbled code is found in editplus, you can directly copy the file content to eclipse, if editplus also has garbled characters, you can first transcode editplus, editplus -> documentation -> file encoding method -> 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.