-
Open Eclipse or MyEclipse
Windows -> Preferences
-
General -> Content type
Java Class File
Under the Text directory
CSS
HTML
Java Properties File
Java Source File
JavaScript Source File
JSP
Refactoring History File
Refactoring History Index
XML
XML(illformed)
Change the Default encoding of the above items to UTF-8 and click Update
-
General -> Workspace
Text file encoding changed to Other:UTF-8
Click Apply OK
-
Right-click on a project developed by yourself
Project right->Properties or left-click->Alt+Enter
-
Resource
Text file encoding 选择 Other:UTF-8
Apply OK
-
Restart Eclipse
After the above 5 steps, the Chinese encoding of Eclipse is set.
For example, question marks and garbled characters are still displayed in Chinese in the database.
Please check database settings
code
filter
Reprinted from Baidu https://jingyan.baidu.com/article/48206aeaa54c62216ad6b399.html