Code Pages Supported by Windows
所谓代码页 (codepage) 就是各国的文字编码和 Unicode 之间的映射表。
例如 GBK 和 Unicode 的映射表就是 CP936,所以也常用 cp936 来指代 GBK。
Code Pages Supported by Windows
The lists below provide links to graphical representations and textual listings of each of the Windows codepages.
SBCS (Single Byte Character Set) Codepages
- 1250 (Central Europe)
- 1251 (Cyrillic)
- 1252 (Latin I)
- 1253 (Greek)
- 1254 (Turkish)
- 1255 (Hebrew)
- 1256 (Arabic)
- 1257 (Baltic)
- 1258 (Vietnam)
- 874 (Thai)
DBCS (Double Byte Character Set) Codepages
In these graphical representations, leadbytes are indicated by light gray background shading.
Each of these leadbytes hyperlinks to a new page showing the 256 character block associated with that leadbyte.
Unused leadbytes are identified by a darker gray background.
Windows OEM Code Pages
The list below provides links to graphical representations, and textual listings, of each of the Windows OEM code pages:
- 437 (US)
- 720 (Arabic)
- 737 (Greek)
- 775 (Baltic)
- 850 (Multilingual Latin I)
- 852 (Latin II)
- 855 (Cyrillic)
- 857 (Turkish)
- 858 (Multilingual Latin I + Euro)
- 862 (Hebrew)
- 866 (Russian)
Windows ANSI and OEM Code Pages
The following codepages are used as both Windows ANSI and OEM codepages:
- 874 (Thai)
- 932 (Japanese Shift-JIS)
- 936 (Simplified Chinese GBK)
- 949 (Korean)
- 950 (Traditional Chinese Big5)
- 1258 (Vietnam)
ISO Code Pages
The list below provides links to graphical representations, and textual listings, of each of the ISO 8859 character sets:
- ISO-8859-1 (Latin 1)
- ISO-8859-2 (Latin 2)
- ISO-8859-3 (Latin 3)
- ISO-8859-4 (Baltic)
- ISO-8859-5 (Cyrillic)
- ISO-8859-6 (Arabic)
- ISO-8859-8 (Hebrew)
- ISO-8859-9 (Turkish)
- ISO-8859-15 (Latin 9)
http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/
CP874.TXT 21-Nov-2006 18:58 8.2K
CP932.TXT 21-Nov-2006 18:58 288K
CP936.TXT 21-Nov-2006 18:59 798K
CP949.TXT 21-Nov-2006 19:00 772K
CP950.TXT 21-Nov-2006 19:01 497K
CP1250.TXT 21-Nov-2006 18:56 9.3K
CP1251.TXT 21-Nov-2006 18:57 9.0K
CP1252.TXT 21-Nov-2006 18:57 9.1K
CP1253.TXT 21-Nov-2006 18:57 8.7K
CP1254.TXT 21-Nov-2006 18:57 9.1K
CP1255.TXT 21-Nov-2006 18:57 8.1K
CP1256.TXT 21-Nov-2006 18:58 8.5K
CP1257.TXT 21-Nov-2006 18:58 9.0K
CP1258.TXT 21-Nov-2006 18:58 9.0K
http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/readme.txt
The following files describe windows code page behavior for the "ansi" code pages provided by Microsoft.
File Code Page Description bestfit874.txt windows-874 ANSI/OEM Thai (same as 28605, ISO 8859-15); Thai (Windows) bestfit932.txt shift_jis ANSI/OEM Japanese; Japanese (Shift-JIS) bestfit936.txt gb2312 ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) bestfit949.txt ks_c_5601-1987 ANSI/OEM Korean (Unified Hangul Code) bestfit950.txt big5 ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) bestfit1250.txt windows-1250 ANSI Central European; Central European (Windows) bestfit1251.txt windows-1251 ANSI Cyrillic; Cyrillic (Windows) bestfit1252.txt windows-1252 ANSI Latin 1; Western European (Windows) bestfit1253.txt windows-1253 ANSI Greek; Greek (Windows) bestfit1254.txt windows-1254 ANSI Turkish; Turkish (Windows) bestfit1255.txt windows-1255 ANSI Hebrew; Hebrew (Windows) bestfit1256.txt windows-1256 ANSI Arabic; Arabic (Windows) bestfit1257.txt windows-1257 ANSI Baltic; Baltic (Windows) bestfit1258.txt windows-1258 ANSI/OEM Vietnamese; Vietnamese (Windows)
These tables include "best fit" behavior which is not present in the other files. Examples of best fit are converting fullwidth letters to their counterparts when converting to single byte code pages, and mapping the Infinity character to the number 8. 932, 936, 949 and 950 are all double byte code pages. The remainder are single byte code pages. Each file is encoded in the code page it describes, eg: bestfit1252.txt is encoded in the windows-1252 encoding. The only non-ASCII characters however are in the comments so these files may be read by an ASCII parser if necessary. Each file has sections of key word tags and records. Any text after a ; is ignored as are blank lines. Fields are delimited by one or more space or tab characters. Each section begins one of the following tags: CODEPAGE CPINFO MBTABLE WCTABLE DBCSRANGE (double byte code pages only) DBSCTABLE (double byte code pages only) Descriptions of each tag are: CODEPAGE 932 ; Japanese - ANSI, OEM The CODEPAGE tag contains 1 field and marks the start of the code page file. Field 1 -- The only field is the decimal windows code page number for this code page. CPINFO 2 0x3f 0x30fb ; DBCS CP, Unic Default Char = Katakana Middle Dot The CPINFO tag describes the code page with 3 fields: Field 1 -- "1" for a single byte code page, "2" for a double byte code page. Field 2 -- Replacement characters for unassigned Unicode code points when written to this code page (currently always ?) Field 3 -- Replacement characters for illegal or unassigned code page values when converting to Unicode. This is Katakana middle dot for 932 and ? for all other code pages. MBTABLE 256 The MBTABLE tag marks the start of the "Multibyte" code page to Unicode conversion table. It has 1 field. Field 1 -- This field contains the number of following records of code page to Unicode mappings. Note that lead bytes dont have mappings, so this is not always 256. For 932 for example it is 196. MultiByte Mapping Records: 0x00 0x0000 ;Null 0x01 0x0001 ;Start Of Heading ... 0x30 0x0030 ;Digit 0 0x31 0x0031 ;Digit 1 ... Each record consists of two fields to map from the code page to Unicode. Field 1 -- The code page byte that is being mapped to Unicode, eg "0x3f" Field 2 -- The Unicode UTF-16 code point that this byte maps to, eg "0x003f" DBCSRANGE 2 ;2 DBCS Lead Byte Ranges: 0x81-0x9f and 0xe0-0xfc The DBSCRANGE describes the number of double byte ranges for double byte code page. Ranges are consecutive lead byte values such as 0x81-0x9f Field 1 -- This field contains the number of double byte ranges. The next record is the 1st lead byte range 0x81 0x9f ;Lead Byte Range This record describes the first lead byte range. It is the first record after DBCSRANGE and is followed by one DBCSTABLE record for each lead byte in the range. If there are additional ranges, another Lead Byte Range record will follow the last DBCSTABLE in the previous range. Field 1 -- This field is the first lead byte used in this range. Field 2 -- This field is the last lead byte used in this range DBCSTABLE 147 ;LeadByte = 0x81 The DBCSTABLE record describes the mappings available for a particular lead byte. The comment is ignored but descriptive. The lead byte of the first DBCSTABLE is the first lead byte of the previous Lead Byte Range record. Each subsequent DBCSTABLE is for the next consecutive lead byte value. Field 1 -- This field is the number of trail byte mappings following. Double byte mapping records: 0x40 0x3000 ; Ideographic Space 0x41 0x3001 ; Ideographic Comma ... Field 1 -- This field is the trail byte to map from. Field 2 -- This field is the Unicode UTF-16 code point that this lead byte/trail byte combination map to. Example: DBCSRANGE 2 ;2 DBCS Lead Byte Ranges: 0x81-0x9f and 0xe0-0xfc 0x81 0x9f ;Lead Byte Range DBCSTABLE 147 ;LeadByte = 0x81 0x40 0x3000 ; Ideographic Space 0x41 0x3001 ; Ideographic Comma ... The preceeding example would map the byte sequences 0x81 0x40 to U+3000 and 0x81 0x41 to U+3001. WCTABLE 698 The WCTABLE tag marks the start of the Unicode UTF-16 (WideChar) to "MultiByte" bytes. It has 1 field. Field 1 -- This field contains the number of records of Unicode to byte mappings. Note that this is often more than the number of round trip mappings supported by the code page due to windows "Best Fit" behavior. Unicode UTF-16 (WideChar) Mapping Records: These take two forms, differing between single byte and double byte code pages. Both forms have 2 fields: Single byte WCTABLE records: 0x0000 0x00 ;Null 0x0001 0x01 ;Start Of Heading ... 0x0061 0x61 ;Latin Small Letter A 0x0062 0x62 ;Latin Small Letter B 0x0063 0x63 ;Latin Small Letter C ... 0x221e 0x38 ;Infinity << Best Fit Mapping ... 0xff41 0x61 ;Fullwidth Latin Small Letter A << Best Fit Mapping 0xff42 0x62 ;Fullwidth Latin Small Letter B << Best Fit Mapping 0xff43 0x63 ;Fullwidth Latin Small Letter C << Best Fit Mapping ... Field 1 -- The Unicode UTF-16 code point for the character being converted. Field 2 -- The single byte that this UTF-16 code point maps to. If a reverse mapping does not in the MBTABLE, then this is a Best Fit mapping. Multibyte WCTABLE records: 0x0000 0x0000 ; Null 0x0001 0x0001 ; Start Of Heading ... 0x0061 0x0061 ; a 0x0062 0x0062 ; b 0x0063 0x0063 ; c ... 0x221e 0x8187 ; Infinity ... 0xff41 0x8281 ; Fullwidth a 0xff42 0x8282 ; Fullwidth b 0xff43 0x8283 ; Fullwidth c ... Field 1 -- The Unicode UTF-16 code point for the character being converted. Field 2 -- The byte or bytes that this code point maps to as a 16 bit value. The high byte is the lead byte, and the low byte is the trail byte. If the high byte is 0, then this is a single byte code point, with the value of the low byte and no lead byte is emitted. ENDCODEPAGE This tag marks the end of the code page data. Anything after this marker is ignored.
bestfit874.txt 04-Oct-2006 15:58 19K
bestfit932.txt 04-Oct-2006 15:58 353K
bestfit936.txt 04-Oct-2006 15:58 852K
bestfit949.txt 04-Oct-2006 15:58 1.2M
bestfit950.txt 04-Oct-2006 15:58 689K
bestfit1250.txt 04-Oct-2006 15:58 36K
bestfit1251.txt 04-Oct-2006 15:58 35K
bestfit1252.txt 04-Oct-2006 15:58 36K
bestfit1253.txt 04-Oct-2006 15:58 33K
bestfit1254.txt 04-Oct-2006 15:58 36K
bestfit1255.txt 04-Oct-2006 15:58 20K
bestfit1256.txt 04-Oct-2006 15:58 29K
bestfit1257.txt 04-Oct-2006 15:58 16K
bestfit1258.txt 04-Oct-2006 15:58 22K
bestfit1361.txt 13-Mar-2012 19:43 1.2M
readme.txt 05-Oct-2006 16:22 7.2K
http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/
CP437.TXT 21-Nov-2006 18:54 9.6K
CP737.TXT 21-Nov-2006 18:54 9.6K
CP775.TXT 21-Nov-2006 18:54 9.5K
CP850.TXT 21-Nov-2006 18:54 9.4K
CP852.TXT 21-Nov-2006 18:54 9.7K
CP855.TXT 21-Nov-2006 18:54 9.3K
CP857.TXT 21-Nov-2006 18:54 9.4K
CP860.TXT 21-Nov-2006 18:54 9.6K
CP861.TXT 21-Nov-2006 18:54 9.6K
CP862.TXT 21-Nov-2006 18:54 9.2K
CP863.TXT 21-Nov-2006 18:54 9.5K
CP864.TXT 21-Nov-2006 18:54 9.3K
CP865.TXT 21-Nov-2006 18:55 9.6K
CP866.TXT 21-Nov-2006 18:55 9.5K
CP869.TXT 21-Nov-2006 18:55 9.1K
CP874.TXT 21-Nov-2006 18:55 8.3K
http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/
CP037.TXT 21-Nov-2006 18:52 8.8K
CP500.TXT 21-Nov-2006 18:53 8.8K
CP875.TXT 21-Nov-2006 18:53 8.5K
CP1026.TXT 21-Nov-2006 18:52 8.8K
http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/MAC/
CYRILLIC.TXT 21-Nov-2006 18:53 9.0K
GREEK.TXT 21-Nov-2006 18:53 9.2K
ICELAND.TXT 21-Nov-2006 18:53 9.0K
LATIN2.TXT 21-Nov-2006 18:53 9.6K
ROMAN.TXT 21-Nov-2006 18:53 9.0K
TURKISH.TXT 21-Nov-2006 18:53 9.0K
1