Home  >  Article  >  Development Tools  >  Notepad opens Chinese garbled characters

Notepad opens Chinese garbled characters

angryTom
angryTomOriginal
2019-08-08 13:50:179008browse

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

Notepad opens Chinese garbled characters

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.

Notepad opens Chinese garbled characters

3. Next, we click "Settings (T)" - "Preferences" in the menu bar, and a dialogue window will appear, see the next picture.

Notepad opens Chinese garbled characters

4. Select "New", change the option of the encoding window inside to "ANSI", save and exit.

Notepad opens Chinese garbled characters

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: https://www.php.cn/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!

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