Has been plagued by the problem of how to display UTF-8 characters in a Windows terminal. For example, in the MySQL command line, if the database encoding is UTF-8, then, when querying the database, the Chinese will become garbled.
Today half-unintentional search, the results found that the solution is very simple:
1. Modify the terminal's code page.
In the terminal, enter:
Chcp 65001
2. Right click on the terminal on the taskbar (you can also click the icon in the upper left corner of the window), select Properties in the shortcut menu, select the font in it--such as Lucida Console, do not select "Dot Matrix Font";
After determining, test the UTF-8 output again and see what you have seen. :)
It's also easy to switch back to the original mode:
CHCP 936
It would be nice to change the font to the original dot matrix font.
"Reprint" displays UTF-8 characters in the Windows terminal