Home  >  Article  >  Java  >  How to solve the garbled code in eclipse java

How to solve the garbled code in eclipse java

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-11-11 14:33:262641browse

How to solve the garbled code in eclipse java

The eclipse project code displays Chinese garbled characters

How to solve the garbled code in eclipse java

There are 4 solutions:

1. Set the encoding method of the workspace

Click the windows menu in the menu

How to solve the garbled code in eclipse java

Select from the drop-down menu. Preferences option.

How to solve the garbled code in eclipse java

Enter the general option, select the workspace option, click Apply, and click OK to exit.

How to solve the garbled code in eclipse java

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.

How to solve the garbled code in eclipse java

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.

How to solve the garbled code in eclipse java

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".

How to solve the garbled code in eclipse java

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.

How to solve the garbled code in eclipse java

Successful setting result

How to solve the garbled code in eclipse java

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn