How to display UTF-8 characters in a DOS window
Author: Finan <li.zhongnan@hotmail.com>
In the Chinese Windows system, if a file contains 8 bytes, the file content cannot be correctly displayed in the cmd.exe command line window (the so-called DOS window. By defaultCodeThe page is Chinese or American, that is, the encoding is Chinese character set or Spanish character set.
If you want to correctly display UTF-8 characters, follow these steps:
1. Open the cmd.exe command line window
2. Use the chcp command to change the code page. The code page of The UTF-8 is 65001.
Chcp 65001
After this operation is performed, the code page is turned into a UTF-8. However, UTF-8 characters still cannot be correctly displayed in the window.
3. Modify window properties and font
Right-click the title bar of the command line, select "property"-> "font", change the font to "lucida console" of true type, and click "OK" to apply the property to the current window.
Then you can use the type command to display the content of the UTF-8 text file:
Type filename.txt
4. the above operations cannot completely solve the problem, because the displayed content may be incomplete. The command line window can be minimized first, and the file content is displayed completely.