How to solve the problem of garbled characters in eclipse?
1. Set the encoding of the workspace
1 The encoding of the editor will affect the display of characters in all projects, which can be said to be the most effective Extensive settings, every project will be affected by this setting. Click Window - Preferences in the menu bar.
2 Click General - Wordspace, and then select the text file encoding format you want to set on the right Encoding format, the system default format is GBK.
Recommended: "Java Tutorial"
2. Set the project encoding
1 If there is no garbled code problem in other projects, but garbled codes appear when displaying individual projects, then we do not need to set the encoding of the workspace, we only need to modify the encoding of the project.
2 After selecting the item, right-click and click Properties in the pop-up menu.
#3 In the pop-up properties window, select Resource - click to select Other, and then select the encoding format you want.
3. Set the encoding of a single file
1 If only some files are garbled, then set the encoding format of individual files. The problem can be solved. Select the garbled file and right-click.
#2 Select Properties in the pop-up menu.
#3 Select the resource in the pop-up properties window, click Other and set the encoding method of individual files.
Notes
The three setting encoding methods have different effects. If the encoding method of the workspace is modified, other projects will be affected. ; If the encoding method of the project is modified, other files will be affected; if the encoding method of the file is modified, only the file will be changed.
The main encoding methods for displaying Chinese are GBK and UTF-8. UTF-8 is an internationally accepted Chinese encoding standard and is recommended.
The above is the detailed content of How to solve garbled characters in eclipse. For more information, please follow other related articles on the PHP Chinese website!