Windows-1252
![]() | |
MIME / IANA | windows-1252[1] |
---|---|
Alias(es) | cp1252 (code page 1252) |
Language(s) | Basically all supported by ISO/IEC 8859-1 e.g. English, Irish, Italian, Norwegian, Portuguese, Spanish, Swedish. Plus also German, Finnish, Icelandic, French, Dutch (except the IJ character), and Slovenian (except the č character). |
Created by | Microsoft |
Standard | WHATWG Encoding Standard |
Classification | extended ASCII, Windows-125x |
Extends | ISO 8859-1 (excluding C1 controls) |
Transforms / Encodes | ISO 8859-15 |
Windows-1252 or CP-1252 (code page 1252) is a single-byte character encoding of the Latin alphabet, used by default in the legacy components of Microsoft Windows for English and many European languages including Spanish, French, and German.
It is the most-used single-byte character encoding in the world (on websites at least). As of January 2022[update], 0.3% of all websites declared use of Windows-1252,[2][3] but at the same time 1.1%[2] used ISO 8859-1 (while only 5 of top-1000 websites[4]), which by HTML5 standards should be considered the same encoding,[5] so that 1.4% of websites effectively use Windows-1252. Pages declared as US-ASCII would also count as this character set. An unknown (but probably large) subset of other pages use only the ASCII portion of UTF-8, or only the codes matching Windows-1252 from their declared character set, and could also be counted.
Depending on the country, use can be much higher than the global average, e.g. for Germany, according to website use (including ISO-8859-1) at 5.1%.[6][7]
Details[edit]
This character encoding is a superset of ISO 8859-1 in terms of printable characters, but differs from the IANA's ISO-8859-1 by using displayable characters rather than control characters in the 80 to 9F (hex) range. Notable additional characters include curly quotation marks and all the printable characters that are in ISO 8859-15 (at different places than ISO 8859-15). It is known to Windows by the code page number 1252, and by the IANA-approved name "windows-1252".
It is very common to mislabel Windows-1252 text with the charset label ISO-8859-1. A common result was that all the quotes and apostrophes (produced by "smart quotes" in word-processing software) were replaced with question marks or boxes on non-Windows operating systems, making text difficult to read. Most modern web browsers and e-mail clients treat the media type charset ISO-8859-1 as Windows-1252 to accommodate such mislabeling. This is now standard behavior in the HTML5 specification, which requires that documents advertised as ISO-8859-1 actually be parsed with the Windows-1252 encoding.[5]
Historically, the phrase "ANSI Code Page" was used in Windows to refer to non-DOS encodings; the intention was that most of these would be ANSI standards such as ISO-8859-1. Even though Windows-1252 was the first and by far most popular code page named so in Microsoft Windows parlance, the code page has never been an ANSI standard. Microsoft explains, "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."[8]
In LaTeX packages, CP-1252 is referred to as "ansinew".
IBM uses code page 1252 (CCSID 1252 and euro sign extended CCSID 5348) for Windows-1252.[9][10][11]
It is called "WE8MSWIN1252" by Oracle.[12]
Character set[edit]
The following table shows Windows-1252. Each character is shown with its Unicode equivalent based on the Unicode.org mapping of Windows-1252 with "best fit".
Windows-1252 (CP1252)[13][14][15][16][17] | ||||||||||||||||
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
0_ | NUL | SOH | STX | ETX | EOT | ENQ | ACK | BEL | BS | HT | LF | VT | FF | CR | SO | SI |
1_ | DLE | DC1 | DC2 | DC3 | DC4 | NAK | SYN | ETB | CAN | EM | SUB | ESC | FS | GS | RS | US |
2_ | SP | ! | " | # | $ | % | & | ' | ( | ) | * | + | , | - | . | / |
3_ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | : | ; | < | = | > | ? |
4_ | @ | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O |
5_ | P | Q | R | S | T | U | V | W | X | Y | Z | [ | \ | ] | ^ | _ |
6_ | ` | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o |
7_ | p | q | r | s | t | u | v | w | x | y | z | { | | | } | ~ | DEL |
8_ | € | ‚ | ƒ | „ | … | † | ‡ | ˆ | ‰ | Š | ‹ | Œ | Ž | |||
9_ | ‘ | ’ | “ | ” | • | – | — | ˜ | ™ | š | › | œ | ž | Ÿ | ||
A_ | NBSP | ¡ | ¢ | £ | ¤ | ¥ | ¦ | § | ¨ | © | ª | « | ¬ | SHY | ® | ¯ |
B_ | ° | ± | ² | ³ | ´ | µ | ¶ | · | ¸ | ¹ | º | » | ¼ | ½ | ¾ | ¿ |
C_ | À | Á | Â | Ã | Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í | Î | Ï |
D_ | Ð | Ñ | Ò | Ó | Ô | Õ | Ö | × | Ø | Ù | Ú | Û | Ü | Ý | Þ | ß |
E_ | à | á | â | ã | ä | å | æ | ç | è | é | ê | ë | ì | í | î | ï |
F_ | ð | ñ | ò | ó | ô | õ | ö | ÷ | ø | ù | ú | û | ü | ý | þ | ÿ |
According to the information on Microsoft's and the Unicode Consortium's websites, positions 81, 8D, 8F, 90, and 9D are unused; however, the Windows API MultiByteToWideChar
maps these to the corresponding C1 control codes. The "best fit" mapping documents this behavior, too.[13]
History[edit]
- The first version of the codepage 1252 used in Microsoft Windows 1.0 did not have positions D7 and F7 defined. All the characters in the ranges 80–9F were undefined too.
- The second version, used in Microsoft Windows 2.0, positions D7, F7, 91, and 92 had been defined.
- The third version, used since Microsoft Windows 3.1, had all the present-day positions defined, except euro sign and Z with caron character pair.
- The final version listed above debuted in Microsoft Windows 98 and was ported to older versions of Windows with the euro symbol update.
OS/2 extensions[edit]
The OS/2 operating system supports an encoding by the name of Code page 1004 (CCSID 1004) or "Windows Extended".[18][19] This mostly matches code page 1252, with the exception of certain C0 control characters being replaced by diacritic characters.
Code page 1004 (differing rows only)[20][21][22][23] | ||||||||||||||||
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
0_ | NUL | SOH | STX | ETX | ˉ | ˘ | ˙ | BEL | ˚ | HT | ˝ | ˛ | ˇ | CR | SO | SI |
MSDOS extensions [rare][edit]
There is a rarely used, but useful, graphics extended code page 1252 where codes 0x00 to 0x1f allow for box drawing as used in applications such as MSDOS Edit and Codeview. One of the applications to use this code page was an Intel Corporation Install/Recovery disk image utility from mid/late 1995. These programs were written for its P6 User Test Program machines (US example[24]). It was used exclusively in its then EMEA region (Europe, Middle East & Africa). In time the programs were changed to use code page 850.
Graphics Extended Code Page 1252[citation needed] | ||||||||||||||||
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
0_ | ○ | ■ | ↑ | ↓ | → | ← | ║ | ═ | ╔ | ╗ | ╚ | ╝ | ░ | ▒ | ► | ◄ |
1_ | │ | ─ | ┌ | ┐ | └ | ┘ | ├ | ┤ | ┴ | ┬ | ♦ | ┼ | █ | ▄ | ▀ | ▬ |
Palm OS variant[edit]
This variant of Windows-1252 is used by Palm OS 3.5. Python gives it the palmos
label.[25]
Palm OS code page[26] | ||||||||||||||||
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
8_ | € | ‚ | ƒ | „ | … | † | ‡ | ˆ | ‰ | Š | ‹ | Œ | ♦ | ♣ | ♥ | |
9_ | ♠ | ‘ | ’ | “ | ” | • | – | — | ˜ | ™ | š | œ | Ÿ |
See also[edit]
References[edit]
- ^ Character Sets, Internet Assigned Numbers Authority (IANA), 2018-12-12
- ^ a b "Historical trends in the usage statistics of character encodings for websites, January 2022". w3techs.com. Retrieved 2022-01-24.
- ^ "Frequenty Asked Questions". w3techs.com.
- ^ "Usage Survey of Character Encodings broken down by Ranking". w3techs.com. Retrieved 2021-10-17.
- ^ a b "Encoding". WHATWG. 27 January 2015. sec. 5.2 Names and labels. Archived from the original on 4 February 2015. Retrieved 4 February 2015.
- ^ "Distribution of Character Encodings among websites that use .de". w3techs.com. Retrieved 2022-01-24.
- ^ "Distribution of Character Encodings among websites that use German". w3techs.com. Retrieved 2022-01-24.
- ^ Wissink, Cathy (5 April 2002). "Unicode and Windows XP" (PDF). Microsoft. p. 1. Archived (PDF) from the original on 4 February 2015. Retrieved 4 February 2015.
- ^ "Code page 1252 information document". Archived from the original on 2016-03-03.
- ^ "CCSID 1252 information document". Archived from the original on 2016-03-26.
- ^ "CCSID 5348 information document". Archived from the original on 2014-11-29.
- ^ "Database Client Installation Guide". Oracle. Retrieved 2021-02-14.
- ^ a b "Unicode mappings of Windows-1252 with 'Best Fit'". Unicode. Archived from the original on 4 February 2015. Retrieved 4 February 2015.
- ^ Code Page CPGID 01252 (pdf) (PDF), IBM
- ^ Code Page CPGID 01252 (txt), IBM
- ^ International Components for Unicode (ICU), ibm-1252_P100-2000.ucm, 2002-12-03
- ^ International Components for Unicode (ICU), ibm-5348_P100-1997.ucm, 2002-12-03
- ^ "Code page 1004 information document". Archived from the original on 2015-06-25.
- ^ "CCSID 1004 information document". Archived from the original on 2016-03-26.
- ^ "Code Page 01004" (PDF). IBM. Archived from the original (PDF) on 2015-07-08. (version based on Windows 3.1 version of Windows-1252)
- ^ Code Page CPGID 01004 (pdf) (PDF), IBM
- ^ Code Page CPGID 01004 (txt), IBM
- ^ Borgendale, Ken (2001). "Codepage 1004 - Windows Extended". OS/2 codepages by number. Archived from the original on 2018-05-13. Retrieved 2018-05-13. (version based on current version of Windows-1252)
- ^ Storaasli, Olaf (1996). "Performance of the NASA equation solvers on computational mechanics applications" (PDF). Performance of NASA Equation Solvers on Computational Mechanics Applications. NASA. doi:10.2514/6.1996-1505. S2CID 15711051. Archived from the original (PDF) on 2019-05-03.
- ^ "codecs — Codec registry and base classes (§ Text Encodings)". The Python Standard Library—Python 3.9.4 Documentation. Python Software Foundation.
- ^ Mullender, Sjoerd (9 December 2021). "Python Character Mapping Codec for Palm OS 3.5". CPython source tree. Python Software Foundation.
External links[edit]
- Microsoft's code charts for Windows-1252 ("Code Page 1252 Windows Latin 1 (ANSI)")
- Unicode mapping table and code page definition with best fit mappings for Windows-1252