Home > Article > Development Tools > What to do if notepad++ is garbled?
When we use Notepad, when we write a program, some parts of it contain Chinese characters, and then an error or garbled code will appear during compilation. In fact, this is a format problem. Let's take java as an example to discuss Let’s learn how to eliminate garbled characters.
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". (Recommended learning: notepad )
Open the command line window, that is, the Windows R key, compile this program, and run it. You will find that the result is like this: The English HelloWorld is displayed normally, but the Chinese "Hello World" is displayed as garbled characters.
Next we click "Settings (T)" - "Preferences" in the menu bar, and a dialogue 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 to do if notepad++ is garbled?. For more information, please follow other related articles on the PHP Chinese website!