CHCP 显示或设置活动代码页数

简单来说 CHCP 命令用来设置 DOS 窗口的编码,DOS 默认代码为 936 简体中文 GBK。

帮助信息

C:\Users\Administrator> chcp /?
显示或设置活动代码页编号。

CHCP [nnn]

  nnn   指定代码页编号。

不带参数键入 CHCP 以显示活动代码页编号。

简单示例

(1)查看默认代码页数

C:\Users\Administrator> chcp
活动代码页: 936

如下图:

(2)将代码页设置为 65001,即 UTF-8,例如:

C:\Users\Administrator> chcp 65001
回车后显示如下信息:
Active code page: 65001

C:\Users\Administrator>

如下图:

CHCP 代码大全如下表:

CodePageidentifier and nameWindowsCodePage
37IBM0371252 *
437IBM4371252 *
500IBM5001252 *
708ASMO-7081256 *
720DOS-7201256 *
737ibm7371253 *
775ibm7751257 *
850ibm8501252 *
852ibm8521250 *
855IBM8551252 *
857ibm8571254 *
858IBM008581252 *
860IBM8601252 *
861ibm8611252 *
862DOS-8621255 *
863IBM8631252 *
864IBM8641256 *
865IBM8651252 *
866cp8661251 *
869ibm8691253 *
870IBM8701250 *
874windows-874874
875cp8751253 *
932shift_jis932
936gb2312936
949ks_c_5601-1987949
950big5950
1026IBM10261254 *
1047IBM010471252 *
1140IBM011401252 *
1141IBM011411252 *
1142IBM011421252 *
1143IBM011431252 *
1144IBM011441252 *
1145IBM011451252 *
1146IBM011461252 *
1147IBM011471252 *
1148IBM011481252 *
1149IBM011491252 *
1200utf-161200
1201unicodeFFFE1200 *
1250windows-12501250
1251windows-12511251
1252Windows-12521252
1253windows-12531253
1254windows-12541254
1255windows-12551255
1256windows-12561256
1257windows-12571257
1258windows-12581258
1361Johab949 *
10000macintosh1252 *
10001x-mac-japanese932 *
10002x-mac-chinesetrad950 *
10003x-mac-korean949 *
10004x-mac-arabic1256 *
10005x-mac-hebrew1255 *
10006x-mac-greek1253 *
10007x-mac-cyrillic1251 *
10008x-mac-chinesesimp936 *
10010x-mac-romanian1250 *
10017x-mac-ukrainian1251 *
10021x-mac-thai874 *
10029x-mac-ce1250 *
10079x-mac-icelandic1252 *
10081x-mac-turkish1254 *
10082x-mac-croatian1250 *
12000utf-321200 *
12001utf-32BE1200 *
20000x-Chinese-CNS950 *
20001x-cp20001950 *
20002x-Chinese-Eten950 *
20003x-cp20003950 *
20004x-cp20004950 *
20005x-cp20005950 *
20105x-IA51252 *
20106x-IA5-German1252 *
20107x-IA5-Swedish1252 *
20108x-IA5-Norwegian1252 *
20127us-ascii1252 *
20261x-cp202611252 *
20269x-cp202691252 *
20273IBM2731252 *
20277IBM2771252 *
20278IBM2781252 *
20280IBM2801252 *
20284IBM2841252 *
20285IBM2851252 *
20290IBM290932 *
20297IBM2971252 *
20420IBM4201256 *
20423IBM4231253 *
20424IBM4241255 *
20833x-EBCDIC-KoreanExtended949 *
20838IBM-Thai874 *
20866koi8-r1251 *
20871IBM8711252 *
20880IBM8801251 *
20905IBM9051254 *
20924IBM009241252 *
20932EUC-JP932 *
20936x-cp20936936 *
20949x-cp20949949 *
21025cp10251251 *
21866koi8-u1251 *
28591iso-8859-11252 *
28592iso-8859-21250 *
28593iso-8859-31254 *
28594iso-8859-41257 *
28595iso-8859-51251 *
28596iso-8859-61256 *
28597iso-8859-71253 *
28598iso-8859-81255 *
28599iso-8859-91254 *
28603iso-8859-131257 *
28605iso-8859-151252 *
29001x-Europa1252 *
38598iso-8859-8-i1255 *
50220iso-2022-jp932 *
50221csISO2022JP932 *
50222iso-2022-jp932 *
50225iso-2022-kr949 *
50227x-cp50227936 *
51932euc-jp932 *
51936EUC-CN936 *
51949euc-kr949 *
52936hz-gb-2312936 *
54936GB18030936 *
57002x-iscii-de57002
57003x-iscii-be57003
57004x-iscii-ta57004
57005x-iscii-te57005
57006x-iscii-as57006
57007x-iscii-or57007
57008x-iscii-ka57008
57009x-iscii-ma57009
57010x-iscii-gu57010
57011x-iscii-pa57011
65000utf-71200 *
65001utf-81200 *
关于
本网站专注于 Java、数据库(MySQL、Oracle)、Linux、软件架构及大数据等多领域技术知识分享。涵盖丰富的原创与精选技术文章,助力技术传播与交流。无论是技术新手渴望入门,还是资深开发者寻求进阶,这里都能为您提供深度见解与实用经验,让复杂编码变得轻松易懂,携手共赴技术提升新高度。如有侵权,请来信告知:hxstrive@outlook.com
公众号