How do I set the support UTF8 encoding in cmd in Windows?

Source: Internet
Author: User

This problem many people will not know at the beginning, of course, including once I, when used, had to resort to the great groove and Niang. There is a way to set up online, but say clearly enough detailed system, say set font for: Lucida Console. The problem is, in the default mode, only the dot matrix font, which has what Lucida Console. So, after your own successful setup, take out and share the next process, let us find out the Lucida console to set it.

Here's what you need to know first:

CHCP

CHCP is a command in MS DOS that is used to display or set the active code page number. Usage is:

CHCP [nnn]

Where nnn specifies the number of the code page. This parameter is optional, and if you do not specify this code page number at the command line, the default is to display the current code page number. For example, in the default CMD window, we enter CHCP, which will appear similar to the following:

Active code page: 936

The 936 here means that the Simplified Chinese (GB2312) encoding is currently in use.

UTF8

You also need to understand some of the coding knowledge, in order to complete support UTF8 work, you need to know at least UTF8 code page number: 65001. More about the content of the code, do not repeat here, please find the relevant content.

With these two points of knowledge, the next step is to make it easier for CMD to support UTF8.

1. Run cmd;

2. Input CHCP, enter to view the current encoding;

3. Input chcp 65001, enter;

4. Only this, still cannot support the normal display of UTF8, you also need to right-click on the form, select Properties, to set the font;

5. After the steps above, even if your original font does not display the Lucida console this font, it should now be seen. Select it. If you have, you can choose it first try, not in the above steps (add: at least I need to chcp 65001, a friend said no);

6. Select Apply only to this form, confirm.

At this time, your console should support UTF8.

Some friends also want to know how to display more fonts in cmd, this is actually a way, as long as in the registry (path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont ) to add the good. It is important to note that the added font needs to be fixed width (fixed-width). Operation:

From here (in English). Need to be directly accessible.

Change the CMD code page to correct the Chinese display

Patriot
    • Release time: 2013/02/13 13:37
    • READ: 10604
    • Favorites: 1
    • Likes: 1
    • Comments: 0

rem English chcp 437 rem Japanese chcp 932 rem Simplified Chinese chcp 936rem Korean chcp 949rem Traditional Chinese chcp  950rem utf- 8chcp  65001                 

If the default code page properties of CMD are not modified, then modify the registry:

1 win key +r Open the Run dialog box and enter Regedit to open the Registry Editor.

2 found [Hkey_current_user\console\%systemroot%_system32_cmd.exe]

3 Modify "CodePage" =dword:000003a8

"note" hexadecimal "000003a8" or decimal "936", which means "936 (ansi/oem-Simplified Chinese GBK)".

if the UTF-8 character is still not displayed correctly after you change the code page to 65001, you need to change the font properties: Right-click on the command line title bar, select Properties, font, and modify the font to True Type font " Lucida Console, then click OK to apply the attribute to the current window.
the above operation does not completely solve the problem, because the content displayed may not be complete. You can minimize and then maximize the command-line window, and the contents of the file are fully displayed.

----------------------------------------------------------------------------------------------------------------

attached: chcp detailed

function Description
Displays the number of code pages for the active console, or changes the active console code page for the console. If used without parameters, CHCP displays the number of active console code pages.

Additional Information
only the original equipment manufacturer (OEM) code page installed with XOX will display correctly in a command prompt window that uses Raster fonts. Other code pages can be displayed correctly in full-screen mode or in a command prompt window that uses TrueType fonts. Just like in MS-DOS, you don't have to prepare code pages. Programs that start after the new code page is assigned will use the new code page, but if the program (except for Cmd.exe) is started before the new code page is assigned, the program will use the original code page.

Grammar
CHCP [NNN]

Parameters
NNN Specifies the code page. The following table lists all supported code pages for MSDOS and their country/region or language:
Code page Country (region) or language
437United States
850 multilingual (Latin I)
852Slavic language (Latin II)
855Cyrillic (Russian)
857           Turkish
860           Portuguese
861           Icelandic
863           Canada-French
865          -Germanic
Russian
869   & nbsp        Modern Greek  
936           Simplified Chinese
950           Traditional Chinese
65001       UTF-8

/? Displays help at the command prompt.

Example
to view the active code page settings, type:

chcp

a message similar to the following appears:
Activity code page: 437

If you want to change the active code page to 850 (multi-language), type:

chcp 850

If the specified code page is not valid, the following error message is displayed:

Invalid code page

How do I set the support UTF8 encoding in cmd in Windows?

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.