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.
There are two groups of code pages in Windows systems: OEM and ANSI code pages. Code pages in both of these groups are extended ASCII code pages.

ANSI code page

ANSI code pages are used for native non-Unicode applications using a graphical user interface on Windows systems. ANSI is a misnomer because the behavior does not exactly match ANSI and because many non-ANSI standard encodings are allowed in these 8-bit code pages, most recently UTF-8 Unicode.
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 similar IBM 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:
About twelve of the typography and business characters from CP1252 at code points 0x80–0x9F are present in many other ANSI/Windows code pages at the same codes.

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

Initially, computer systems and system programming languages did not make a distinction between characters and bytes. This led to much confusion subsequently. Microsoft software and systems previous to the Windows NT line are examples of this, using the OEM and ANSI code pages, which do not make the distinction.
Since the late 1990s, software and systems are increasingly adopting more direct encodings of Unicode, in particular UTF-8 and UTF-16; this trend has been improved by the widespread adoption of XML, which provides a more adequate mechanism for labelling the encoding used. Recent Microsoft products and application program interfaces use Unicode internally, but many applications and APIs continue to use the default encoding of the computer's locale when reading and writing text data to files or standard output. Therefore, though Unicode is the accepted standard, there is still backwards compatibility with the older Windows code pages.
The euro sign was introduced after many of the ANSI and OEM code pages were introduced; several code pages were revised to contain the euro sign.
Since version 1803, Windows machines can be configured to allow UTF-8 as the "ANSI" and OEM codepage.

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 as windows-<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.
IDDescriptionRelationship to ISO 8859 or other established encodings
1250Latin 2 / Central European
1251Cyrillic
1252Latin 1 / Western European
1253Greek
1254Turkish
1255Hebrew
1256Arabic
1257Baltic
1258Vietnamese

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.
These often only partly match the IBM code pages of the same number: code pages 932, 936 and 949 differ from the IBM code pages of the same number, whereas Windows-951, as part of a kludge, is unrelated to IBM-951. IBM equivalent code pages are given in the second column. Code pages 932, 936, 949 and 950/951 are used as both ANSI and OEM code pages on the locales in question.
IDIBM EquivalentLanguageEncodingUse
932943JapaneseShift JIS ANSI/OEM
9361386Chinese GBKANSI/OEM
9491363KoreanUnified Hangul CodeANSI/OEM
9501370, 1373Chinese Big5 ANSI/OEM
9515471Chinese Big5-HKSCS 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.
IDIBM EquivalentLanguageEncodingUse
1361-KoreanJohab Conversion
20000964Chinese CNS 11643Conversion
20001-Chinese TCAConversion
20002-Chinese Big5 Conversion
20003?Chinese IBM 5500Conversion
20004-Chinese TeletextConversion
20005-Chinese WangConversion
20932954 JapaneseEUC-JPConversion

EBCDIC code pages

Microsoft strongly recommends using Unicode in modern applications, but many applications or data files still depend on the legacy code pages.