In Windows, the CMD/compiler cannot enter Chinese characters, and Chinese garbled characters are displayed
Two months ago, when I made the C++ course design, Chinese garbled appeared in the compiler compilation result of the computer, so I sought baidu and the great god, but failed to solve this problem. Baidu gave a lot of explanations about setting the compiler, but none of them had any effect. During the summer vacation, I learned to develop Java programs with Dos. When entering CMD command dir(directory) for query operation, a lot of Chinese garbled characters were displayed. Originally, I wanted to reinstall the system, but there were a lot of important things in the computer, so I spent some time tinker with the computer and finally solved the above two problems. Now I am very happy and attached the following two pictures:
CMD query interface :(Chinese)
Codeblocks compile screen :(in Chinese)
Read on to find out how:
CMD problems in the general CMD to find the cause, also can use regedit, that is, the registry to solve.
After reading this article, you can also take a closer look at CMD and Regedit. The following is my personal experience and is for reference only, not official opinion.
Specific solutions:
1. Right-click CMD and click Default values. In the options default code page, select 936.
2, Enter CMD:
chcp 936
Note: The CHCP command is used to display or set the active code page number.
3, Create a new text, copy and paste the following code, and change the file type to reg: Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe] “CodePage”= DWORD :000003a8
Then double-click to run. The point is.
4. Run regedit to open the registry.
Find the CodePage in HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe.
Double-click to open CodePage and type 3a8
After completing the above four steps, I believe you have successfully solved the garbled code problem! A little bit of technical advice, will share more experience of the article to everyone!