Windows-1252

From Wikipedia, the free encyclopedia
  (Redirected from CP1252)
Jump to navigation Jump to search
Windows-1252
Windows-1252-infobox.svg
MIME / IANAwindows-1252
Language(s)English, various others
Created byMicrosoft
StandardWHATWG Encoding Standard
Classificationextended ASCII, Windows-125x
ExtendsISO 8859-1 (excluding C1 controls)
Transforms / EncodesISO 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 in English and some other Western languages (other languages use different default encodings).

It is probably the most-used 8-bit character encoding in the world. As of March 2019, 0.6% of all web sites declared use of Windows-1252,[1][2] but at the same time 3.4% used ISO 8859-1,[1] which by HTML5 standards should be considered the same encoding,[3] so that 4.0% of web sites effectively used Windows-1252. In addition, most web browsers will correctly render it if encountered in text that claims to be UTF-8, so its actual usage may be higher.

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.[3]

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."[4]

In LaTeX packages, CP-1252 is referred to as "ansinew".

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".[5]

Windows-1252 (CP1252)
_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F
0_
0
NUL
0000
SOH
0001
STX
0002
ETX
0003
EOT
0004
ENQ
0005
ACK
0006
BEL
0007
BS
0008
HT
0009
LF
000A
VT
000B
FF
000C
CR
000D
SO
000E
SI
000F
1_
16
DLE
0010
DC1
0011
DC2
0012
DC3
0013
DC4
0014
NAK
0015
SYN
0016
ETB
0017
CAN
0018
EM
0019
SUB
001A
ESC
001B
FS
001C
GS
001D
RS
001E
US
001F
2_
32
SP
0020
!
0021
"
0022
#
0023
$
0024
%
0025
&
0026
'
0027
(
0028
)
0029
*
002A
+
002B
,
002C
-
002D
.
002E
/
002F
3_
48
0
0030
1
0031
2
0032
3
0033
4
0034
5
0035
6
0036
7
0037
8
0038
9
0039
:
003A
;
003B
<
003C
=
003D
>
003E
?
003F
4_
64
@
0040
A
0041
B
0042
C
0043
D
0044
E
0045
F
0046
G
0047
H
0048
I
0049
J
004A
K
004B
L
004C
M
004D
N
004E
O
004F
5_
80
P
0050
Q
0051
R
0052
S
0053
T
0054
U
0055
V
0056
W
0057
X
0058
Y
0059
Z
005A
[
005B
\
005C
]
005D
^
005E
_
005F
6_
96
`
0060
a
0061
b
0062
c
0063
d
0064
e
0065
f
0066
g
0067
h
0068
i
0069
j
006A
k
006B
l
006C
m
006D
n
006E
o
006F
7_
112
p
0070
q
0071
r
0072
s
0073
t
0074
u
0075
v
0076
w
0077
x
0078
y
0079
z
007A
{
007B
|
007C
}
007D
~
007E
DEL
007F
8_
128

20AC
 
201A
ƒ
0192

201E

2026

2020

2021
ˆ
02C6

2030
Š
0160

2039
Œ
0152
  Ž
017D
 
9_
144
 
2018

2019

201C

201D

2022

2013

2014
˜ 
02DC

2122
š
0161

203A
œ
0153
  ž
017E
Ÿ
0178
A_
160
NBSP
00A0
¡
00A1
¢
00A2
£
00A3
¤
00A4
¥
00A5
¦
00A6
§
00A7
¨
00A8
©
00A9
ª
00AA
«
00AB
¬
00AC
SHY
00AD
®
00AE
¯
00AF
B_
176
°
00B0
±
00B1
²
00B2
³
00B3
´
00B4
µ
00B5

00B6
·
00B7
¸
00B8
¹
00B9
º
00BA
»
00BB
¼
00BC
½
00BD
¾
00BE
¿
00BF
C_
192
À
00C0
Á
00C1
Â
00C2
Ã
00C3
Ä
00C4
Å
00C5
Æ
00C6
Ç
00C7
È
00C8
É
00C9
Ê
00CA
Ë
00CB
Ì
00CC
Í
00CD
Î
00CE
Ï
00CF
D_
208
Ð
00D0
Ñ
00D1
Ò
00D2
Ó
00D3
Ô
00D4
Õ
00D5
Ö
00D6
×
00D7
Ø
00D8
Ù
00D9
Ú
00DA
Û
00DB
Ü
00DC
Ý
00DD
Þ
00DE
ß
00DF
E_
224
à
00E0
á
00E1
â
00E2
ã
00E3
ä
00E4
å
00E5
æ
00E6
ç
00E7
è
00E8
é
00E9
ê
00EA
ë
00EB
ì
00EC
í
00ED
î
00EE
ï
00EF
F_
240
ð
00F0
ñ
00F1
ò
00F2
ó
00F3
ô
00F4
õ
00F5
ö
00F6
÷
00F7
ø
00F8
ù
00F9
ú
00FA
û
00FB
ü
00FC
ý
00FD
þ
00FE
ÿ
00FF

  Letter   Number   Punctuation   Symbol   Other   undefined   Differences from ISO-8859-1

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.[5]

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.

See also[edit]

References[edit]

  1. ^ a b "Historical trends in the usage of character encodings, February 2019". Retrieved 2019-02-18.
  2. ^ "Frequently Asked Questions".
  3. ^ 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.
  4. ^ 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.
  5. ^ a b "Unicode mappings of Windows-1252 with 'Best Fit'". Unicode. Archived from the original on 4 February 2015. Retrieved 4 February 2015.

Further reading[edit]

External links[edit]