Windows code page
Windows code pages are sets of characters or code pages used in Microsoft Windows from the 1980s and 1990s. Windows code pages were gradually superseded when Unicode was implemented in Windows, although they are still supported both within Windows and other platforms, and still apply when Alt code shortcuts are used.
Current Windows versions support Unicode, new Windows applications should use Unicode and not 8-bit character encodings.
There are two groups of system code pages in Windows systems: OEM and Windows-native code pages.
Code pages in both of these groups are extended ASCII code pages. Additional code pages are supported by standard Windows conversion routines, but not used as either type of system code page.
ANSI code page
ANSI code pages are used for native non-Unicode applications using a graphical user interface on Windows systems. The term "ANSI" is a misnomer because these Windows code pages do not comply with any ANSI standard; code page 1252 was based on an early ANSI draft that became the international standard ISO 8859-1, which adds a further 32 control codes and space for 96 printable characters. Among other differences, Windows code-pages allocate printable characters to the supplementary control code space, making them at best illegible to standards-compliant operating systems.Most legacy "ANSI" code pages have code page numbers in the pattern 125x. However, 874 and the East Asian multi-byte "ANSI" code pages, all of which are also used as OEM code pages, are numbered to match IBM encodings, none of which are identical to the Windows encodings. While code page 1258 is also used as an OEM code page, it is original to Microsoft rather than an extension to an existing encoding. IBM have assigned their own, different numbers for Microsoft's variants, these are given for reference in the lists below where applicable.
All of the 125x Windows code pages, as well as 874 and 936, are labelled by Internet Assigned Numbers Authority as "Windows-number", although "Windows-936" is treated as a synonym for "GBK". Windows code page 932 is instead labelled as "Windows-31J".
ANSI Windows code pages, and especially the code page 1252, were so called since they were purportedly based on drafts submitted or intended for ANSI. However, ANSI and ISO have not standardized any of these code pages. Instead they are either:
- Supersets of the standard sets such as those of ISO 8859 and the various national standards,
- Major modifications of these
- Having no parallel encoding. Also, Windows-1251 follows neither the ISO-standardised ISO-8859-5 nor the then-prevailing KOI-8.
OEM code page
The OEM code pages are used by Win32 console applications, and by virtual DOS, and can be considered a holdover from DOS and the original IBM PC architecture. A separate suite of code pages was implemented not only due to compatibility, but also because the fonts of VGA hardware suggest encoding of line-drawing characters to be compatible with code page 437. Most OEM code pages share many code points, particularly for non-letter characters, with the second half of CP437.A typical OEM code page, in its second half, does not resemble any ANSI/Windows code page even roughly. Nevertheless, two single-byte, fixed-width code pages and four multibyte CJK code pages are used as both OEM and ANSI code pages. Code page 1258 uses combining diacritics, as Vietnamese requires more than 128 letter-diacritic combinations. This is in contrast to VISCII, which replaces some of the C0 control codes.
History
Early computer systems had limited storage and restricted the number of bits available to encode a character. Although earlier proprietary encodings had fewer, the American Standard Code for Information Interchange settled on seven bits: this was sufficient to encode a 96 member subset of the characters used in the US. As eight-bit bytes came to predominate, Microsoft expanded the repertoire to 224, to handle a variety of other uses such a box-drawing symbols. The need to provide precomposed characters for the Western European and South American markets required a different character set: Microsoft established the principle of code pages, one for each alphabet. For the segmental scripts used in most of Africa, the Americas, southern and south-east Asia, the Middle East and Europe, a character needs just one byte but two or more bytes are needed for the ideographic sets used in the rest of the world. The code-page model was unable to handle this challenge.Since the late 1990s, software and systems have adopted Unicode as their preferred character encoding format: Unicode is designed to handle millions of characters. All current Microsoft products and application program interfaces use Unicode internally, but some applications continue to use the default encoding of the computer's 'locale' when reading and writing text data to files or standard output. Therefore, files may still be encountered that are legible and intelligible in one part of the world but unintelligible mojibake in another.
UTF-8, UTF-16
Microsoft adopted a Unicode encoding, i.e. UTF-16 for all its operating systems from Windows NT onwards, but additionally supports UTF-8 since Windows 10 version 1803.UTF-16 uniquely encodes all Unicode characters in the Basic Multilingual Plane using 16 bits but the remaining Unicode is encoded with a 32-bit code while the rest of the industry, and now Microsoft chose UTF-8.
List
The following Windows code pages exist:Windows-125x series
These nine code pages are all extended ASCII 8-bit SBCS encodings, and were designed by Microsoft for use as ANSI codepages on Windows. They are commonly known by their IANA-registered names aswindows-<number>, but are also sometimes called cp<number>, "cp" for "code page". They are all used as ANSI code pages; Windows-1258 is also used as an OEM code page.The Windows-125x series includes nine of the ANSI code pages, and mostly covers scripts from Europe and West Asia with the addition of Vietnam. System encodings for Thai and for East Asian languages were numbered to match similar IBM code pages and are used as both ANSI and OEM code pages; these are covered in following sections.
| ID | Description | Relationship to ISO 8859 or other established encodings |
| 1250 | Latin 2 / Central European | |
| 1251 | Cyrillic | |
| 1252 | Latin 1 / Western European | |
| 1253 | Greek | |
| 1254 | Turkish | |
| 1255 | Hebrew | |
| 1256 | Arabic | |
| 1257 | Baltic | |
| 1258 | Vietnamese |
DOS code pages
These are also ASCII-based. Most of these are included for use as OEM code pages; code page 874 is also used as an ANSI code page.- 437 – IBM PC US, 8-bit SBCS extended ASCII. Known as OEM-US, the encoding of the primary built-in font of VGA graphics cards.
- 708 – Arabic, extended ISO 8859-6
- 720 – Arabic, retaining box drawing characters in their usual locations
- 737 – "MS-DOS Greek". Retains all box drawing characters. More popular than 869.
- 775 – "MS-DOS Baltic Rim"
- 850 – "MS-DOS Latin 1". Full repertoire of ISO 8859-1.
- 852 – "MS-DOS Latin 2"
- 855 – "MS-DOS Cyrillic". Mainly used for South Slavic languages. Includes repertoire of ISO-8859-5. Not to be confused with cp866.
- 857 – "MS-DOS Turkish"
- 858 – Western European with euro sign
- 860 – "MS-DOS Portuguese"
- 861 – "MS-DOS Icelandic"
- 862 – "MS-DOS Hebrew"
- 863 – "MS-DOS French Canada"
- 864 – Arabic
- 865 – "MS-DOS Nordic"
- 866 – "MS-DOS Cyrillic Russian", cp866. Sole purely OEM code page included as a legacy encoding in WHATWG Encoding Standard for HTML5.
- 869 – "MS-DOS Greek 2", IBM869. Full repertoire of ISO 8859-7.
- 874 – Thai, also used as the ANSI code page, extends ISO 8859-11 with a few additional characters from Windows-1252. Corresponds to IBM code page 1162.
East Asian multi-byte code pages
| ID | Language | Encoding | IBM Equivalent | Difference from IBM CCSID of same number | Use |
| 932 | Japanese | Shift JIS | 943 | IBM-932 is also Shift JIS, has fewer extensions, and swaps some variant Chinese characters for interoperability with earlier editions of JIS C 6226. | ANSI/OEM |
| 936 | Chinese | GBK | 1386 | IBM-936 is a different Simplified Chinese encoding with a different encoding method, which has been deprecated since 1993. | ANSI/OEM |
| 949 | Korean | Unified Hangul Code | 1363 | IBM-949 is also an EUC-KR superset, but with different extensions. | ANSI/OEM |
| 950 | Chinese | Big5 | 1373 | IBM-950 is also Big5, but includes a different subset of the ETEN extensions, adds further extensions with an expanded trail byte range, and lacks the Euro. | ANSI/OEM |
| 951 | Chinese including Cantonese | Big5-HKSCS | 5471 | IBM-951 is the double-byte plane from IBM-949, and unrelated to Microsoft's internal use of the number 951. | ANSI/OEM |
A few further multiple-byte code pages are supported for decoding or encoding using operating system libraries, but not used as either sort of system encoding in any locale.
| ID | IBM Equivalent | Language | Encoding | Use |
| 1361 | - | Korean | Johab | Conversion |
| 20000 | - | Chinese | An encoding of CNS 11643 | Conversion |
| 20001 | - | Chinese | TCA | Conversion |
| 20002 | - | Chinese | Big5 | Conversion |
| 20003 | 938 | Chinese | IBM 5550 | Conversion |
| 20004 | - | Chinese | Teletext | Conversion |
| 20005 | - | Chinese | Wang | Conversion |
| 20932 | 954 | Japanese | EUC-JP | Conversion |
| 20936 | 5479 | Chinese | GB 2312 | Conversion |
| 20949, 51949 | 970 | Korean | Wansung | Conversion |