Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
I was asked about our use of the windows "ansi" code page names, as used in things like MIME types, http content-type tags, etc. Each "code page" has a name that most accuratly round trips back to the same code page, which I've listed as the "preferred name" below. Additionally, when you ask for a code page matching a name, some code pages have several aliases that map to the identical behavior. (listed as "aliases" in the table below).
Note that there are quite a few inconsistencies and other odd behaviors. Some have names of windows-xxx, and others don't even recognize that form as an alias. Additionally some reference material I've seen refers to any microsoft code page in the windows-xxxx or CPxxx form, whether or not windows itself recognizes those names.
We have no intention of trying to create a more consistent naming scheme, we prefer that applications use Unicode.
So in practice, you should use the "preferred name" to identify data tagged by a particular code page, but if you are accepting input data, recognize that it may also use one of the listed aliases. Encoding.GetEncoding() should "do the right thing". You might want to look at my previous posts "Encoding.GetEncodings() has a couple "duplicate" names" and "What's my Encoding Called?".
Preferred Name:
windows-874
Aliases:
DOS-874
iso-8859-11
TIS-620
Preferred Name:
shift_jis
Aliases:
csShiftJIS
csWindows31J
ms_Kanji
shift-jis
sjis
x-ms-cp932
x-sjis
Preferred Name:
gb2312
Aliases:
chinese
CN-GB
csGB2312
csGB231280
csISO58GB231280
GB2312-80
GB231280
GBK
GB_2312-80
iso-ir-58
Preferred Name:
ks_c_5601-1987
Aliases:
csKSC56011987
iso-ir-149
korean
ks-c-5601
ks-c5601
KSC5601
KSC_5601
ks_c_5601
ks_c_5601-1989
ks_c_5601_1987
Preferred Name:
big5
Aliases:
Big5-HKSCS
cn-big5
csbig5
x-x-big5
Preferred Name:
windows-1250
Aliases:
x-cp1250
Preferred Name:
windows-1251
Aliases:
x-cp1251
Preferred Name:
Windows-1252
Aliases:
x-ansi
Preferred Name:
windows-1253
Preferred Name:
windows-1254
Preferred Name:
windows-1255
Preferred Name:
windows-1256
Aliases:
cp1256
Preferred Name:
windows-1257
Preferred Name:
windows-1258
Please sign in to use this experience.
Sign in