MFC Code Page

WINBASEAPI
BOOL
WINAPI
GetCPInfoExA(
    _In_ UINT          CodePage,
    _In_ DWORD         dwFlags,
    _Out_ LPCPINFOEXA  lpCPInfoEx);
WINBASEAPI
BOOL
WINAPI
GetCPInfoExW(
    _In_ UINT          CodePage,
    _In_ DWORD         dwFlags,
    _Out_ LPCPINFOEXW  lpCPInfoEx);

GetCPInfoExA function

Retrieves information about any valid installed or available code page.

Syntax

C++复制

BOOL GetCPInfoExA(
  UINT        CodePage,
  DWORD       dwFlags,
  LPCPINFOEXA lpCPInfoEx
);

Parameters

CodePage

Identifier for the code page for which to retrieve information. The application can specify the code page identifier for any installed or available code page, or one of the following predefined values. See Code Page Identifiers for a list of identifiers for ANSI and other code pages.

ValueMeaning

CP_ACP

Use the system default Windows ANSI code page.

CP_MACCP

Use the system default Macintosh code page.

CP_OEMCP

Use the system default OEM code page.

CP_THREAD_ACP

Use the current thread's ANSI code page.

dwFlags

Reserved; must be 0.

lpCPInfoEx

Pointer to a CPINFOEX structure that receives information about the code page.

Return Value

Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can return one of the following error codes:

  • ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.

Remarks

The information retrieved in the CPINFOEX structure is not always useful for all code pages. To determine buffer sizes, for example, the application should call MultiByteToWideChar or WideCharToMultiByte to request an accurate buffer size. If CPINFOEX settings indicate that a lead byte exists, the conversion function does not necessarily handle lead bytes differently, for example, in the case of a missing or illegal trail byte.

Requirements

  
Minimum supported clientWindows 2000 Professional [desktop apps | UWP apps]
Minimum supported serverWindows 2000 Server [desktop apps | UWP apps]
Target PlatformWindows
Headerwinnls.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll

See Also

CPINFOEX

GetACP

GetCPInfo

GetOEMCP

National Language Support

National Language Support Functions

2:Code Page Identifiers

https://docs.microsoft.com/zh-cn/windows/desktop/Intl/code-page-identifiers

he following table defines the available code page identifiers.

 备注

ANSI code pages can be different on different computers, or can be changed for a single computer, leading to data corruption. For the most consistent results, applications should use Unicode, such as UTF-8 or UTF-16, instead of a specific code page.

 

Identifier.NET NameAdditional information
037IBM037IBM EBCDIC US-Canada
437IBM437OEM United States
500IBM500IBM EBCDIC International
708ASMO-708Arabic (ASMO 708)
709 Arabic (ASMO-449+, BCON V4)
710 Arabic - Transparent Arabic
720DOS-720Arabic (Transparent ASMO); Arabic (DOS)
737ibm737OEM Greek (formerly 437G); Greek (DOS)
775ibm775OEM Baltic; Baltic (DOS)
850ibm850OEM Multilingual Latin 1; Western European (DOS)
852ibm852OEM Latin 2; Central European (DOS)
855IBM855OEM Cyrillic (primarily Russian)
857ibm857OEM Turkish; Turkish (DOS)
858IBM00858OEM Multilingual Latin 1 + Euro symbol
860IBM860OEM Portuguese; Portuguese (DOS)
861ibm861OEM Icelandic; Icelandic (DOS)
862DOS-862OEM Hebrew; Hebrew (DOS)
863IBM863OEM French Canadian; French Canadian (DOS)
864IBM864OEM Arabic; Arabic (864)
865IBM865OEM Nordic; Nordic (DOS)
866cp866OEM Russian; Cyrillic (DOS)
869ibm869OEM Modern Greek; Greek, Modern (DOS)
870IBM870IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2
874windows-874ANSI/OEM Thai (ISO 8859-11); Thai (Windows)
875cp875IBM EBCDIC Greek Modern
932shift_jisANSI/OEM Japanese; Japanese (Shift-JIS)
936gb2312ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312)
949ks_c_5601-1987ANSI/OEM Korean (Unified Hangul Code)
950big5ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5)
1026IBM1026IBM EBCDIC Turkish (Latin 5)
1047IBM01047IBM EBCDIC Latin 1/Open System
1140IBM01140IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro)
1141IBM01141IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro)
1142IBM01142IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro)
1143IBM01143IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro)
1144IBM01144IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro)
1145IBM01145IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro)
1146IBM01146IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro)
1147IBM01147IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro)
1148IBM01148IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro)
1149IBM01149IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro)
1200utf-16Unicode UTF-16, little endian byte order (BMP of ISO 10646); available only to managed applications
1201unicodeFFFEUnicode UTF-16, big endian byte order; available only to managed applications
1250windows-1250ANSI Central European; Central European (Windows)
1251windows-1251ANSI Cyrillic; Cyrillic (Windows)
1252windows-1252ANSI Latin 1; Western European (Windows)
1253windows-1253ANSI Greek; Greek (Windows)
1254windows-1254ANSI Turkish; Turkish (Windows)
1255windows-1255ANSI Hebrew; Hebrew (Windows)
1256windows-1256ANSI Arabic; Arabic (Windows)
1257windows-1257ANSI Baltic; Baltic (Windows)
1258windows-1258ANSI/OEM Vietnamese; Vietnamese (Windows)
1361JohabKorean (Johab)
10000macintoshMAC Roman; Western European (Mac)
10001x-mac-japaneseJapanese (Mac)
10002x-mac-chinesetradMAC Traditional Chinese (Big5); Chinese Traditional (Mac)
10003x-mac-koreanKorean (Mac)
10004x-mac-arabicArabic (Mac)
10005x-mac-hebrewHebrew (Mac)
10006x-mac-greekGreek (Mac)
10007x-mac-cyrillicCyrillic (Mac)
10008x-mac-chinesesimpMAC Simplified Chinese (GB 2312); Chinese Simplified (Mac)
10010x-mac-romanianRomanian (Mac)
10017x-mac-ukrainianUkrainian (Mac)
10021x-mac-thaiThai (Mac)
10029x-mac-ceMAC Latin 2; Central European (Mac)
10079x-mac-icelandicIcelandic (Mac)
10081x-mac-turkishTurkish (Mac)
10082x-mac-croatianCroatian (Mac)
12000utf-32Unicode UTF-32, little endian byte order; available only to managed applications
12001utf-32BEUnicode UTF-32, big endian byte order; available only to managed applications
20000x-Chinese_CNSCNS Taiwan; Chinese Traditional (CNS)
20001x-cp20001TCA Taiwan
20002x_Chinese-EtenEten Taiwan; Chinese Traditional (Eten)
20003x-cp20003IBM5550 Taiwan
20004x-cp20004TeleText Taiwan
20005x-cp20005Wang Taiwan
20105x-IA5IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5)
20106x-IA5-GermanIA5 German (7-bit)
20107x-IA5-SwedishIA5 Swedish (7-bit)
20108x-IA5-NorwegianIA5 Norwegian (7-bit)
20127us-asciiUS-ASCII (7-bit)
20261x-cp20261T.61
20269x-cp20269ISO 6937 Non-Spacing Accent
20273IBM273IBM EBCDIC Germany
20277IBM277IBM EBCDIC Denmark-Norway
20278IBM278IBM EBCDIC Finland-Sweden
20280IBM280IBM EBCDIC Italy
20284IBM284IBM EBCDIC Latin America-Spain
20285IBM285IBM EBCDIC United Kingdom
20290IBM290IBM EBCDIC Japanese Katakana Extended
20297IBM297IBM EBCDIC France
20420IBM420IBM EBCDIC Arabic
20423IBM423IBM EBCDIC Greek
20424IBM424IBM EBCDIC Hebrew
20833x-EBCDIC-KoreanExtendedIBM EBCDIC Korean Extended
20838IBM-ThaiIBM EBCDIC Thai
20866koi8-rRussian (KOI8-R); Cyrillic (KOI8-R)
20871IBM871IBM EBCDIC Icelandic
20880IBM880IBM EBCDIC Cyrillic Russian
20905IBM905IBM EBCDIC Turkish
20924IBM00924IBM EBCDIC Latin 1/Open System (1047 + Euro symbol)
20932EUC-JPJapanese (JIS 0208-1990 and 0212-1990)
20936x-cp20936Simplified Chinese (GB2312); Chinese Simplified (GB2312-80)
20949x-cp20949Korean Wansung
21025cp1025IBM EBCDIC Cyrillic Serbian-Bulgarian
21027 (deprecated)
21866koi8-uUkrainian (KOI8-U); Cyrillic (KOI8-U)
28591iso-8859-1ISO 8859-1 Latin 1; Western European (ISO)
28592iso-8859-2ISO 8859-2 Central European; Central European (ISO)
28593iso-8859-3ISO 8859-3 Latin 3
28594iso-8859-4ISO 8859-4 Baltic
28595iso-8859-5ISO 8859-5 Cyrillic
28596iso-8859-6ISO 8859-6 Arabic
28597iso-8859-7ISO 8859-7 Greek
28598iso-8859-8ISO 8859-8 Hebrew; Hebrew (ISO-Visual)
28599iso-8859-9ISO 8859-9 Turkish
28603iso-8859-13ISO 8859-13 Estonian
28605iso-8859-15ISO 8859-15 Latin 9
29001x-EuropaEuropa 3
38598iso-8859-8-iISO 8859-8 Hebrew; Hebrew (ISO-Logical)
50220iso-2022-jpISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)
50221csISO2022JPISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana)
50222iso-2022-jpISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI)
50225iso-2022-krISO 2022 Korean
50227x-cp50227ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022)
50229 ISO 2022 Traditional Chinese
50930 EBCDIC Japanese (Katakana) Extended
50931 EBCDIC US-Canada and Japanese
50933 EBCDIC Korean Extended and Korean
50935 EBCDIC Simplified Chinese Extended and Simplified Chinese
50936 EBCDIC Simplified Chinese
50937 EBCDIC US-Canada and Traditional Chinese
50939 EBCDIC Japanese (Latin) Extended and Japanese
51932euc-jpEUC Japanese
51936EUC-CNEUC Simplified Chinese; Chinese Simplified (EUC)
51949euc-krEUC Korean
51950 EUC Traditional Chinese
52936hz-gb-2312HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ)
54936GB18030Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030)
57002x-iscii-deISCII Devanagari
57003x-iscii-beISCII Bangla
57004x-iscii-taISCII Tamil
57005x-iscii-teISCII Telugu
57006x-iscii-asISCII Assamese
57007x-iscii-orISCII Odia
57008x-iscii-kaISCII Kannada
57009x-iscii-maISCII Malayalam
57010x-iscii-guISCII Gujarati
57011x-iscii-paISCII Punjabi
65000utf-7Unicode (UTF-7)
65001utf-8Unicode (UTF-8)

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值