ANSI code pages (officially called "Windows code pages"2 after Microsoft accepted the former term being a misnomer3) are used for native non-Unicode (say, byte oriented) 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 (American National Standards Institute) standard; code page 1252 was based on an early ANSI draft that became the international standard ISO 8859-1,4 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 (Thai) and the East Asian multi-byte "ANSI" code pages (932, 936, 949, 950), 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 (although most are similar). 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 (IANA) as "Windows-number", although "Windows-936" is treated as a synonym for "GBK". Windows code page 932 is instead labelled as "Windows-31J".5
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:6
Microsoft assigned about twelve of the typography and business characters (including notably, the euro sign, €) in CP1252 to the code points 0x80–0x9F that, in ISO 8859, are assigned to C1 control codes. These assignments are also present in many other ANSI/Windows code pages at the same code-points. Windows did not use the C1 control codes, so this decision had no direct effect on Windows users. However, if included in a file transferred to a standards-compliant platform like Unix or MacOS, the information was invisible and potentially disruptive.
The OEM code pages (original equipment manufacturer) 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 (and descendant) 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 (non-ASCII) 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 (874 for Thai and 1258 for Vietnamese) and four multibyte CJK code pages (932, 936, 949, 950) 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 (i.e. ASCII) control codes.
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 (ASCII) 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 (and others) 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.
Microsoft adopted a Unicode encoding (first the now-obsolete UCS-2, which was then Unicode's only encoding), i.e. UTF-16 for all its operating systems from Windows NT onwards, but additionally supports UTF-8 (aka CP_UTF8) since Windows 10 version 1803.7 UTF-16 uniquely encodes all Unicode characters in the Basic Multilingual Plane (BMP) using 16 bits but the remaining Unicode (e.g. emojis) is encoded with a 32-bit (four byte) code – while the rest of the industry (Unix-like systems and the web), and now Microsoft chose UTF-8 (which uses one byte for the 7-bit ASCII character set, two or three bytes for other characters in the BMP, and four bytes for the remainder).
The following Windows code pages exist:
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-registered8 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.
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.
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 differ from the IBM code pages of the same number: code pages 932, 949 and 950 only partly match the IBM code pages of the same number, while the number 936 was used by IBM for another Simplified Chinese encoding which is now deprecated and 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.
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.
Microsoft strongly recommends using Unicode in modern applications, but many applications or data files still depend on the legacy code pages.
"Unicode and character sets". Microsoft. 2023-06-13. Retrieved 2024-05-27. https://learn.microsoft.com/en-us/windows/win32/intl/unicode-and-character-sets ↩
"Code Pages". 2016-03-07. Archived from the original on 2016-03-07. Retrieved 2021-05-26. https://web.archive.org/web/20160307222735/https://msdn.microsoft.com/en-us/goglobal/bb964653.aspx ↩
"Glossary of Terms Used on this Site". December 8, 2018. Archived from the original on 2018-12-08. The term "ANSI" as used to signify Windows code pages is a historical reference, but is nowadays a misnomer that continues to persist in the Windows community. The source of this comes from the fact that the Windows code page 1252 was originally based on an ANSI draft—which became International Organization for Standardization (ISO) Standard 8859-1. "ANSI applications" are usually a reference to non-Unicode or code page–based applications. https://web.archive.org/web/20181208141313/https://msdn.microsoft.com/en-us/goglobal/bb964658.aspx#a ↩
"Character Sets". www.iana.org. Archived from the original on 2021-05-25. Retrieved 2021-05-26. http://www.iana.org/assignments/character-sets/character-sets.xhtml ↩
hylom (2017-11-14). "Windows 10のInsider PreviewでシステムロケールをUTF-8にするオプションが追加される" [The option to make UTF-8 the system locale added in Windows 10 Insider Preview]. スラド (in Japanese). Archived from the original on 2018-05-11. Retrieved 2018-05-10. https://srad.jp/story/17/11/14/0640253/ ↩
"Character Sets". IANA. Archived from the original on 2016-12-03. Retrieved 2019-04-07. https://www.iana.org/assignments/character-sets/character-sets.xhtml ↩
Microsoft. "Windows 1250". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://msdn.microsoft.com/en-us/goglobal/cc305143 ↩
IBM. "SBCS code page information document CPGID 01250". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://www-01.ibm.com/software/globalization/cp/cp01250.html ↩
Microsoft. "Windows 1251". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://msdn.microsoft.com/en-us/goglobal/cc305144 ↩
IBM. "SBCS code page information document CPGID 01251". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://www-01.ibm.com/software/globalization/cp/cp01251.html ↩
Microsoft. "Windows 1252". Archived from the original on 2013-05-04. Retrieved 2014-07-06. http://msdn.microsoft.com/en-us/goglobal/cc305145 ↩
IBM. "SBCS code page information document CPGID 01252". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://www-01.ibm.com/software/globalization/cp/cp01252.html ↩
Microsoft. "Windows 1253". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://msdn.microsoft.com/en-us/goglobal/cc305146 ↩
IBM. "SBCS code page information document CPGID 01253". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://www-01.ibm.com/software/globalization/cp/cp01253.html ↩
Microsoft. "Windows 1254". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://msdn.microsoft.com/en-us/goglobal/cc305147 ↩
IBM. "SBCS code page information document CPGID 01254". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://www-01.ibm.com/software/globalization/cp/cp01254.html ↩
Microsoft. "Windows 1255". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://msdn.microsoft.com/en-us/goglobal/cc305148 ↩
IBM. "SBCS code page information document CPGID 01255". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://www-01.ibm.com/software/globalization/cp/cp01255.html ↩
Microsoft. "Windows 1256". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://msdn.microsoft.com/en-us/goglobal/cc305149 ↩
IBM. "SBCS code page information document CPGID 01256". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://www-01.ibm.com/software/globalization/cp/cp01256.html ↩
Microsoft. "Windows 1257". Archived from the original on 2013-03-16. Retrieved 2014-07-06. http://msdn.microsoft.com/en-us/goglobal/cc305150 ↩
IBM. "SBCS code page information document CPGID 01257". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://www-01.ibm.com/software/globalization/cp/cp01257.html ↩
Microsoft. "Windows 1258". Archived from the original on 2013-10-25. Retrieved 2014-07-06. http://msdn.microsoft.com/en-us/goglobal/cc305151 ↩
IBM. "SBCS code page information document CPGID 01258". Archived from the original on 2014-07-14. Retrieved 2014-07-06. http://www-01.ibm.com/software/globalization/cp/cp01258.html ↩
IBM. "SBCS code page information document - CPGID 00437". Archived from the original on 2016-06-09. Retrieved 2014-07-04. http://www-01.ibm.com/software/globalization/cp/cp00437.html ↩
"IBM-943 and IBM-932". IBM Knowledge Center. IBM. Archived from the original on 2018-08-18. Retrieved 2020-07-08. https://www.ibm.com/support/knowledgecenter/en/ssw_aix_71/com.ibm.aix.nlsgdrf/ibm-943_ibm-932.htm ↩
"Converter Explorer: ibm-1373_P100-2002". ICU Demonstration. International Components for Unicode. Archived from the original on 2021-05-26. Retrieved 2020-06-27. http://icu-project.org/icu-bin/convexp?conv=ibm-1373_P100-2002 ↩
"Coded character set identifiers – CCSID 5471". IBM Globalization. IBM. Archived from the original on 2014-11-29. https://web.archive.org/web/20141129233053/http://www-01.ibm.com/software/globalization/ccsid/ccsid5471.html ↩
Julliard, Alexandre (11 March 2021). "dump_krwansung_codepage: build Korean Wansung table from the KSX1001 file". make_unicode: Generate code page .c files from ftp.unicode.org descriptions. Wine Project. Archived from the original on 2021-05-26. Retrieved 2021-03-14. https://source.winehq.org/git/wine.git/blob/6f68543692a7588daa581d00c475715395036b15:/tools/make_unicode#l946 ↩
IBM. "SBCS code page information document - CPGID 00037". Archived from the original on 2014-07-14. Retrieved 2014-07-04. http://www-01.ibm.com/software/globalization/cp/cp00037.html ↩
Steele, Shawn (2005-09-12). "Code Page 21027 "Extended/Ext Alpha Lowercase"". MSDN. Archived from the original on 2019-04-06. Retrieved 2019-04-06. https://blogs.msdn.microsoft.com/shawnste/2005/09/12/code-page-21027-extendedext-alpha-lowercase/ ↩
"Code Page Identifiers". docs.microsoft.com. Archived from the original on 2019-04-07. Retrieved 2019-04-07. https://docs.microsoft.com/en-gb/windows/desktop/Intl/code-page-identifiers ↩
Mozilla Foundation. "Relationship with Windows Code Pages". Crate encoding_rs. Docs.rs. /wiki/Mozilla_Foundation ↩
"Code Page Identifiers". Microsoft Developer Network. Microsoft. 2014. Archived from the original on 2016-06-19. Retrieved 2016-06-19. https://msdn.microsoft.com/de-de/en-en/library/windows/desktop/dd317756(v=vs.85).aspx ↩
"Web Encodings - Internet Explorer - Encodings". WHATWG Wiki. 2012-10-23. Archived from the original on 2016-06-20. Retrieved 2016-06-20. https://wiki.whatwg.org/wiki/Web_Encodings#Encodings_3 ↩
Foller, Antonin (2014) [2011]. "Western European (IA5) encoding - Windows charsets". WUtils.com - Online web utility and help. Motobit Software. Archived from the original on 2016-06-20. Retrieved 2016-06-20. http://wutils.com/encodings/x-ia5 ↩
Foller, Antonin (2014) [2011]. "German (IA5) encoding – Windows charsets". WUtils.com – Online web utility and help. Motobit Software. Archived from the original on 2016-06-20. Retrieved 2016-06-20. http://wutils.com/encodings/x-ia5-german ↩
Foller, Antonin (2014) [2011]. "Swedish (IA5) encoding - Windows charsets". WUtils.com - Online web utility and help. Motobit Software. Archived from the original on 2016-06-20. Retrieved 2016-06-20. http://wutils.com/encodings/x-ia5-swedish ↩
Foller, Antonin (2014) [2011]. "Norwegian (IA5) encoding - Windows charsets". WUtils.com - Online web utility and help. Motobit Software. Archived from the original on 2016-06-20. Retrieved 2016-06-20. http://wutils.com/encodings/x-ia5-norwegian ↩
Foller, Antonin (2014) [2011]. "US-ASCII encoding - Windows charsets". WUtils.com - Online web utility and help. Motobit Software. Archived from the original on 2016-06-20. Retrieved 2016-06-20. http://wutils.com/encodings/us-ascii ↩
Nechayev, Valentin (2013) [2001]. "Review of 8-bit Cyrillic encodings universe". Archived from the original on 2016-12-05. Retrieved 2016-12-05. http://segfault.kiev.ua/cyrillic-encodings/ ↩