The eclipse project code displays Chinese garbled characters
There are 4 solutions:
1. Set the encoding method of the workspace
Click the windows menu in the menu
Select from the drop-down menu. Preferences option.
Enter the general option, select the workspace option, click Apply, and click OK to exit.
2. Set the encoding method for a single project
Right-click the project project and select the last item " Properties".
Select Resource (the first one) in the menu tree on the left of the new window that opens, then find Text file encoding on the right, select "other", and select the required encoding method in the drop-down box.
3. Set the encoding method of a type of file
Suppose you want to set the js file encoding method to UTF-8, then It should be Window->General->Content Types, select JavaScript Source File in Content Types, select *.js in the File associations column, then enter UTF-8 in the Default Encoding column, click Update, and save.
4. Set the encoding method of a single file
Right-click the file to be modified and select the last one in the pop-up menu Item "Properties".
Select Info (the first one) in the menu tree on the left of the new window that opens, then find Text file encoding on the right, select "other", and select "other" in the drop-down box Select the required encoding method. The method is similar to modifying the project coding method.
Successful setting result
php Chinese website, a lot of free Java introductory tutorial, welcome to learn online!
The above is the detailed content of How to solve the garbled code in eclipse java. For more information, please follow other related articles on the PHP Chinese website!