Solve the Problem of command line garbled code and encoding

Source: Internet
Author: User


To solve the problem of command line garbled code and encoding, run the command chcp www.2cto.com to display or set the active code page number CHCP [nnn] nnn to specify the code page number. If no parameter is added, type CHCP to display the active code page number. Nnn specifies an existing system character set, which is defined by the COUNTRY command in the CONFIG. SYS file. In DOS, you can use the mode command to set the code page. SELECT the code page: mode con [:] cp select = yyy Code Page STATUS: mode con [:] CP [/STATUS] Press Windows + R and Enter cmd or command to open the command prompt. For example, if the input is mode con cp select = 936, the system displays Simplified Chinese. If the input mode con cp select = 437, it indicates that the MS-DOS is displayed in American English, and the Chinese display will be ?.
The MS-DOS provides character sets for the following countries and languages: the code page describes www.2cto.com 1258 Vietnamese 1257 Boro 1256 Arabic 1255 Hebrew 1254 Turkish 1253 Greek 1252 Latin 1 character (ANSI) 1251 Spanish language 1250 Central European language 950 traditional Chinese 949 Korean 936 Simplified Chinese (default) 932 Japanese 874 Thai 850 multilingual (MS-DOS Latin1) 437 MS-DOS United States English // supplemental dos commands: chcp 65001 is replaced with the UTF-8 code page chcp 936 can be switched back to the default GBK chcp 437 is the United States English how to display UTF-8 characters in the DOS window in the Chinese Windowssystem, if a file is 8 characters, then in the cmd.exe command line window (so-called DOS window) file content cannot be correctly displayed. By default, the code page used in the command line window is Chinese or American, that is, the Code is a Chinese or Spanish character set. To display the UTF-8 characters correctly, follow these steps: 1、open the cmd.exe command line window 2, change the code page through the chcp command, the code page for the UTF-8 is 65001 chcp 65001 after performing this operation, 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. Right-click the title bar of the command line and choose "properties"> "font" to change the font to "Lucida Console" of "True Type ", 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, through the above operation does not 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.