Three ways:
I. Setting the encoding of the workspace
- 1
The encoding of the editor affects the display of characters in all items, which can be said to be the most widely used setting, and each item is affected by this setting. Click the window in the menu bar--option (Preferences).
- 2
Click General--working space (wordspace), then select the encoding format you want to set in the text file encoding format on the right, and the default format for the system is GBK.
END
Two. Set the encoding for the project
- 1
If the other items do not have garbled problem, but the individual items appear garbled, then we do not need to set the work space coding, only need to modify the code of the project.
- 2
When the item is selected, right-click and click Properties in the Pop-up menu.
- 3
In the pop-up Properties window, select Resources (Resource)--click Select Other, then select the encoding format you want.
END
Three. Set the encoding for individual files
- 1
Only individual files garbled, then set the encoding format of individual files can solve the problem. Select the file that has garbled characters, and then right-click.
- 2
In the pop-up menu, select Properties.
- 3
Select the resource in the pop-up Properties window and click Other to set the encoding for individual files.
END
Precautions
- There are three different ways to set the encoding, if you modify the encoding of the workspace, then the other items will be affected, modify the encoding of the project, the other files will be affected, and modify the way the file is encoded, only the file changes.
- Display Chinese all the encoding method is mainly GBK and Utf-8,utf-8 is the international standard of Chinese encoding, recommended to use.
What about eclipse garbled?