Open Notepad, create a new file HelloWorld.java and save it under the root directory of drive F, then type the code in it and print out "HelloWorld Hello World".
Open the command line window, that is, Windows R key, compile this program, and run it. You will find that the result is like this: English HelloWorld is displayed normally, while Chinese "Hello World" It will be displayed as garbled characters.
Related recommendations: "Notepad usage graphic tutorial"
Next we click "Settings (T)" in the menu bar - —"Preferences", a dialog window will appear, see the next picture.
Select "New", change the option of the encoding window inside to "ANSI", save and exit.
Rewrite the HelloWorld.java program and print the output in the command line window. You will find that the program displays normally.
The above is the detailed content of What should I do if notepad displays garbled characters in Chinese?. For more information, please follow other related articles on the PHP Chinese website!