Home >Development Tools >notepad >Notepad opens Chinese garbled characters
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 how to eliminate garbled characters.
Recommended tutorial: notepad usage tutorial
1. Open Notepad, create a new file HelloWorld.java and save it in F Under the root directory of the disk, type the code inside and print out "HelloWorld Hello World".
2. 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, while the Chinese "Hello" World" is displayed as garbled characters.
3. Next, we click "Settings (T)" - "Preferences" in the menu bar, and a dialogue window will appear, see the next picture.
4. Select "New", change the option of the encoding window inside to "ANSI", save and exit.
5. Re-write the HelloWorld.java program and print the output in the command line window. You will find that the program displays normally.
If your problem cannot be solved, you can refer to this article: //m.sbmmt.com/tool/notepad/427987.html
The above is the detailed content of Notepad opens Chinese garbled characters. For more information, please follow other related articles on the PHP Chinese website!