Sometimes Chinese characters are garbled in the Windows console. If the console executes Chinese characters at this time, the expected results will not be achieved. The reason for garbled characters varies with the actual situation.
Solution
① Open the console, right-click the title attribute, and you can see the currentCodePage to see if "936 (ANSI/oem-Simplified Chinese GBK)". If not, the console page is changed. Enter "chcp" and press Enter. You can also enter the current code page. If the code page is not 936, enter "chcp 936" on the console to set the code page to Chinese.
② Open the registry, find the HKEY_CURRENT_USER \ console, and then there is a currpage on the right that is probably the key, the value seems to be 25, I don't remember it. However, some computers may not have this registration key. For example, if I have a 64-bit Windows 7 player, modify it as needed. Haha
What about this?ProgramIf Chinese characters are garbled during running on the target machine, the consequences can be imagined. Therefore, you can set the current code page before calling the console.
For more code pages, see:
Chcp, code page
[Thank you for your reference]