Jump to content

Code page 437

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 206.172.0.204 (talk) at 21:10, 27 January 2016 (Alt Codes: it was a choice, not a requirement.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Code page 437, as rendered by an IBM PC using a VGA adapter.

Code page 437 is the character set of the original IBM PC (personal computer), or MS-DOS. It is also known as CP437, OEM 437,[1] PC-8,[2] or MS-DOS Latin US.[3] The set includes ASCII codes 32–126, extended codes for accented letters (diacritics), some Greek letters, icons, and line-drawing symbols. It is sometimes referred to as the "OEM font" or "high ASCII", or as "extended ASCII"[2] (one of many mutually incompatible ASCII extensions).

In a strict sense, this character set was not conceived as a code page; it was simply the graphical glyph repertoire available in the original IBM PC. This character set remains the primary font in the core of any EGA and VGA-compatible graphics card. Text shown when a PC reboots, before any other font can be loaded from a storage medium, typically is rendered with this "Code Page".[4] Many file formats developed at the time of the IBM PC, such as .nfo, define this as the default encoding.

Display adapters

The code page stored in ROM is also called the hardware code page. In Western PCs it typically defaults to code page 437, but various Eastern European PCs used a number of other code pages as their hardware code page, sometimes user-selectable via jumpers or CMOS setup. Arabic and Hebrew PCs and printers even supported multiple software-switchable hardware code pages, also named font pages.

The original IBM PC contained this font as a 9×14 pixels-per-character font stored in the ROM of the IBM Monochrome Display Adapter (MDA) and an 8×8 pixels-per-character font of the Color Graphics Adapter (CGA) cards. The IBM Enhanced Graphics Adapter (EGA) contained an 8×14 pixels-per-character version, and the VGA contained a 9×16 version.

All these display adapters have text modes in which each character cell contains an 8-bit character code point (see details), giving 256 possible values for graphic characters. All 256 codes were assigned a graphical character in ROM, including the codes from 0 to 31 that were reserved in ASCII for non-graphical control characters.

Alt Codes

A legacy of code page 437 and other DOS codepages is the set of number combinations used in Windows Alt keycodes introduced in the first versions of MS-DOS. The user could enter a character by holding down the Alt key and entering the three-digit decimal Alt keycode on the numpad. When Microsoft switched to more standard character sets (such as CP1252 and later Unicode) in Windows, so many users had memorized the numbers used by their DOS codepage that Microsoft chose to retain the original codes (they added the ability to type a code in the current character set by typing the numpad 0 before the digits)[citation needed].

Characters

The following tables show code page 437. Each character is shown with its equivalent Unicode code point and its decimal code point. See also the notes below as there are multiple equivalent Unicode characters for some code points. The decimal codes are also known as Alt codes.

Although the ROM provides a graphic for all 256 different possible 8-bit codes, some APIs that ostensibly support code page 437 will not print some or all of these code points, in particular the range 1-31 and the code at 127.[5] Instead they will interpret them as control characters. For instance the BIOS on the original IBM PC has a character-output command that would interpret the codes for CR, LF, BS, and some others. Code 26 (^Z) could not be stored in MSDOS text files as it indicated end of file. Many printers were also unable to print these characters.

Code page 437[6]
_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F
0_ Template:Chset-color-undef| Template:Chset-color-ext-punct|
263A
1
Template:Chset-color-ext-punct|
263B
2
Template:Chset-color-ext-punct|
2665
3
Template:Chset-color-ext-punct|
2666
4
Template:Chset-color-ext-punct|
2663
5
Template:Chset-color-ext-punct|
2660
6
Template:Chset-color-ext-punct|
2022
7
Template:Chset-color-graph|
25D8
8
Template:Chset-color-graph|
25CB
9
Template:Chset-color-graph|
25D9
10
Template:Chset-color-ext-punct|
2642
11
Template:Chset-color-ext-punct|
2640
12
Template:Chset-color-ext-punct|
266A
13
Template:Chset-color-ext-punct|
266B
14
Template:Chset-color-ext-punct|
263C
15
1_ Template:Chset-color-graph|
25BA
16
Template:Chset-color-graph|
25C4
17
Template:Chset-color-ext-punct|
2195
18
Template:Chset-color-ext-punct|
203C
19
Template:Chset-color-ext-punct|
00B6
20
Template:Chset-color-ext-punct|§
00A7
21
Template:Chset-color-graph|
25AC
22
Template:Chset-color-ext-punct|
21A8
23
Template:Chset-color-ext-punct|
2191
24
Template:Chset-color-ext-punct|
2193
25
Template:Chset-color-ext-punct|
2192
26
Template:Chset-color-ext-punct|
2190
27
Template:Chset-color-ext-punct|
221F
28
Template:Chset-color-ext-punct|
2194
29
Template:Chset-color-graph|
25B2
30
Template:Chset-color-graph|
25BC
31
2_ Template:Chset-color-punct|SP
0020
32
Template:Chset-color-punct|!
0021
33
Template:Chset-color-punct|"
0022
34
Template:Chset-color-punct|#
0023
35
Template:Chset-color-punct|$
0024
36
Template:Chset-color-punct|%
0025
37
Template:Chset-color-punct|&
0026
38
Template:Chset-color-punct|'
0027
39
Template:Chset-color-punct|(
0028
40
Template:Chset-color-punct|)
0029
41
Template:Chset-color-punct|*
002A
42
Template:Chset-color-punct|+
002B
43
Template:Chset-color-punct|,
002C
44
Template:Chset-color-punct|-
002D
45
Template:Chset-color-punct|.
002E
46
Template:Chset-color-punct|/
002F
47
3_ Template:Chset-color-digit|0
0030
48
Template:Chset-color-digit|1
0031
49
Template:Chset-color-digit|2
0032
50
Template:Chset-color-digit|3
0033
51
Template:Chset-color-digit|4
0034
52
Template:Chset-color-digit|5
0035
53
Template:Chset-color-digit|6
0036
54
Template:Chset-color-digit|7
0037
55
Template:Chset-color-digit|8
0038
56
Template:Chset-color-digit|9
0039
57
Template:Chset-color-punct|:
003A
58
Template:Chset-color-punct|;
003B
59
Template:Chset-color-punct|<
003C
60
Template:Chset-color-punct|=
003D
61
Template:Chset-color-punct|>
003E
62
Template:Chset-color-punct|?
003F
63
4_ Template:Chset-color-punct|@
0040
64
Template:Chset-color-alpha|A
0041
65
Template:Chset-color-alpha|B
0042
66
Template:Chset-color-alpha|C
0043
67
Template:Chset-color-alpha|D
0044
68
Template:Chset-color-alpha|E
0045
69
Template:Chset-color-alpha|F
0046
70
Template:Chset-color-alpha|G
0047
71
Template:Chset-color-alpha|H
0048
72
Template:Chset-color-alpha|I
0049
73
Template:Chset-color-alpha|J
004A
74
Template:Chset-color-alpha|K
004B
75
Template:Chset-color-alpha|L
004C
76
Template:Chset-color-alpha|M
004D
77
Template:Chset-color-alpha|N
004E
78
Template:Chset-color-alpha|O
004F
79
5_ Template:Chset-color-alpha|P
0050
80
Template:Chset-color-alpha|Q
0051
81
Template:Chset-color-alpha|R
0052
82
Template:Chset-color-alpha|S
0053
83
Template:Chset-color-alpha|T
0054
84
Template:Chset-color-alpha|U
0055
85
Template:Chset-color-alpha|V
0056
86
Template:Chset-color-alpha|W
0057
87
Template:Chset-color-alpha|X
0058
88
Template:Chset-color-alpha|Y
0059
89
Template:Chset-color-alpha|Z
005A
90
Template:Chset-color-punct|[
005B
91
Template:Chset-color-punct|\
005C
92
Template:Chset-color-punct|]
005D
93
Template:Chset-color-punct|^
005E
94
Template:Chset-color-punct|_
005F
95
6_ Template:Chset-color-punct|`
0060
96
Template:Chset-color-alpha|a
0061
97
Template:Chset-color-alpha|b
0062
98
Template:Chset-color-alpha|c
0063
99
Template:Chset-color-alpha|d
0064
100
Template:Chset-color-alpha|e
0065
101
Template:Chset-color-alpha|f
0066
102
Template:Chset-color-alpha|g
0067
103
Template:Chset-color-alpha|h
0068
104
Template:Chset-color-alpha|i
0069
105
Template:Chset-color-alpha|j
006A
106
Template:Chset-color-alpha|k
006B
107
Template:Chset-color-alpha|l
006C
108
Template:Chset-color-alpha|m
006D
109
Template:Chset-color-alpha|n
006E
110
Template:Chset-color-alpha|o
006F
111
7_ Template:Chset-color-alpha|p
0070
112
Template:Chset-color-alpha|q
0071
113
Template:Chset-color-alpha|r
0072
114
Template:Chset-color-alpha|s
0073
115
Template:Chset-color-alpha|t
0074
116
Template:Chset-color-alpha|u
0075
117
Template:Chset-color-alpha|v
0076
118
Template:Chset-color-alpha|w
0077
119
Template:Chset-color-alpha|x
0078
120
Template:Chset-color-alpha|y
0079
121
Template:Chset-color-alpha|z
007A
122
Template:Chset-color-punct|{
007B
123
Template:Chset-color-punct||
007C
124
Template:Chset-color-punct|}
007D
125
Template:Chset-color-punct|~
007E
126
Template:Chset-color-ext-punct|
2302
127
8_ Template:Chset-color-intl|Ç
00C7
128
Template:Chset-color-intl|ü
00FC
129
Template:Chset-color-intl|é
00E9
130
Template:Chset-color-intl|â
00E2
131
Template:Chset-color-intl|ä
00E4
132
Template:Chset-color-intl|à
00E0
133
Template:Chset-color-intl|å
00E5
134
Template:Chset-color-intl|ç
00E7
135
Template:Chset-color-intl|ê
00EA
136
Template:Chset-color-intl|ë
00EB
137
Template:Chset-color-intl|è
00E8
138
Template:Chset-color-intl|ï
00EF
139
Template:Chset-color-intl|î
00EE
140
Template:Chset-color-intl|ì
00EC
141
Template:Chset-color-intl|Ä
00C4
142
Template:Chset-color-intl|Å
00C5
143
9_ Template:Chset-color-intl|É
00C9
144
Template:Chset-color-intl|æ
00E6
145
Template:Chset-color-intl|Æ
00C6
146
Template:Chset-color-intl|ô
00F4
147
Template:Chset-color-intl|ö
00F6
148
Template:Chset-color-intl|ò
00F2
149
Template:Chset-color-intl|û
00FB
150
Template:Chset-color-intl|ù
00F9
151
Template:Chset-color-intl|ÿ
00FF
152
Template:Chset-color-intl|Ö
00D6
153
Template:Chset-color-intl|Ü
00DC
154
Template:Chset-color-ext-punct|¢
00A2
155
Template:Chset-color-ext-punct|£
00A3
156
Template:Chset-color-ext-punct|¥
00A5
157
Template:Chset-color-ext-punct|
20A7
158
Template:Chset-color-intl|ƒ
0192
159
A_ Template:Chset-color-intl|á
00E1
160
Template:Chset-color-intl|í
00ED
161
Template:Chset-color-intl|ó
00F3
162
Template:Chset-color-intl|ú
00FA
163
Template:Chset-color-intl|ñ
00F1
164
Template:Chset-color-intl|Ñ
00D1
165
Template:Chset-color-ext-punct|ª
00AA
166
Template:Chset-color-ext-punct|º
00BA
167
Template:Chset-color-ext-punct|¿
00BF
168
Template:Chset-color-ext-punct|
2310
169
Template:Chset-color-ext-punct|¬
00AC
170
Template:Chset-color-ext-punct|½
00BD
171
Template:Chset-color-ext-punct|¼
00BC
172
Template:Chset-color-ext-punct|¡
00A1
173
Template:Chset-color-ext-punct|«
00AB
174
Template:Chset-color-ext-punct|»
00BB
175
B_ Template:Chset-color-graph|
2591
176
Template:Chset-color-graph|
2592
177
Template:Chset-color-graph|
2593
178
Template:Chset-color-graph|
2502
179
Template:Chset-color-graph|
2524
180
Template:Chset-color-graph|
2561
181
Template:Chset-color-graph|
2562
182
Template:Chset-color-graph|
2556
183
Template:Chset-color-graph|
2555
184
Template:Chset-color-graph|
2563
185
Template:Chset-color-graph|
2551
186
Template:Chset-color-graph|
2557
187
Template:Chset-color-graph|
255D
188
Template:Chset-color-graph|
255C
189
Template:Chset-color-graph|
255B
190
Template:Chset-color-graph|
2510
191
C_ Template:Chset-color-graph|
2514
192
Template:Chset-color-graph|
2534
193
Template:Chset-color-graph|
252C
194
Template:Chset-color-graph|
251C
195
Template:Chset-color-graph|
2500
196
Template:Chset-color-graph|
253C
197
Template:Chset-color-graph|
255E
198
Template:Chset-color-graph|
255F
199
Template:Chset-color-graph|
255A
200
Template:Chset-color-graph|
2554
201
Template:Chset-color-graph|
2569
202
Template:Chset-color-graph|
2566
203
Template:Chset-color-graph|
2560
204
Template:Chset-color-graph|
2550
205
Template:Chset-color-graph|
256C
206
Template:Chset-color-graph|
2567
207
D_ Template:Chset-color-graph|
2568
208
Template:Chset-color-graph|
2564
209
Template:Chset-color-graph|
2565
210
Template:Chset-color-graph|
2559
211
Template:Chset-color-graph|
2558
212
Template:Chset-color-graph|
2552
213
Template:Chset-color-graph|
2553
214
Template:Chset-color-graph|
256B
215
Template:Chset-color-graph|
256A
216
Template:Chset-color-graph|
2518
217
Template:Chset-color-graph|
250C
218
Template:Chset-color-graph|
2588
219
Template:Chset-color-graph|
2584
220
Template:Chset-color-graph|
258C
221
Template:Chset-color-graph|
2590
222
Template:Chset-color-graph|
2580
223
E_ Template:Chset-color-intl|α
03B1
224
Template:Chset-color-intl-var|ß
00DF
225
Template:Chset-color-intl|Γ
0393
226
Template:Chset-color-intl-var|π
03C0
227
Template:Chset-color-intl-var|Σ
03A3
228
Template:Chset-color-intl|σ
03C3
229
Template:Chset-color-intl-var|µ
00B5
230
Template:Chset-color-intl|τ
03C4
231
Template:Chset-color-intl|Φ
03A6
232
Template:Chset-color-intl|Θ
0398
233
Template:Chset-color-intl-var|Ω
03A9
234
Template:Chset-color-intl-var|δ
03B4
235
Template:Chset-color-ext-punct|
221E
236
Template:Chset-color-intl-var|φ
03C6
237
Template:Chset-color-intl-var|ε
03B5
238
Template:Chset-color-ext-punct|
2229
239
F_ Template:Chset-color-ext-punct|
2261
240
Template:Chset-color-ext-punct|±
00B1
241
Template:Chset-color-ext-punct|
2265
242
Template:Chset-color-ext-punct|
2264
243
Template:Chset-color-ext-punct|
2320
244
Template:Chset-color-ext-punct|
2321
245
Template:Chset-color-ext-punct|÷
00F7
246
Template:Chset-color-ext-punct|
2248
247
Template:Chset-color-ext-punct|°
00B0
248
Template:Chset-color-ext-punct|
2219
249
Template:Chset-color-ext-punct|·
00B7
250
Template:Chset-color-ext-punct|
221A
251
Template:Chset-color-ext-punct|
207F
252
Template:Chset-color-ext-punct|²
00B2
253
Template:Chset-color-graph|
25A0
254
Template:Chset-color-ext-punct-var|NBSP
00A0
255
_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F

Implementers of translation to Unicode should note that these codes do not have a unique, single Unicode equivalent and the correct choice depends upon context:

  • 0 and 255 (FFhex) both draw a blank space, as does 32 (20hex). The use of 255 for U+00A0 Non-breaking space (NBSP) has some precedent in word processors designed for the IBM PC.
  • 225 (E1hex) is both the German sharp S (U+00DF, ß) and the Greek lowercase beta (U+03B2, β).
  • 227 (E3hex) is the Greek lowercase pi (U+03C0, π), but early fonts such as Terminal use a variant of pi that is ambiguous in case, and therefore can be used for the Greek capital pi (U+03A0, Π) or the n-ary product sign (U+220F, ∏).
  • 228 (E4hex) is both the n-ary summation sign (U+2211, ∑) and the Greek uppercase sigma (U+03A3, Σ).
  • 230 (E6hex) is both the micro sign (U+00B5, µ) and the Greek lowercase mu (U+03BC, μ).
  • 234 (EAhex) is both the ohm sign (U+2126, Ω) and the Greek uppercase omega (U+03A9, Ω). (Unicode considers the ohm sign to be equivalent to uppercase omega, and suggests that the latter be used in both contexts.[7]).
  • 235 (EBhex) is the Greek lowercase delta (U+03B4, δ), but it has also been used as a surrogate for the Icelandic lowercase eth (U+00F0, ð) and the partial derivative sign (U+2202, ∂).
  • 237 (EDhex) is supposed to be used as Greek lowercase phi, but is mainly used as the empty set sign (U+2205, ∅) and was also used as the Greek phi symbol in italics (U+03D5, Φ) to name angles, diameter sign (U+2300, ⌀), and as a surrogate for the Latin lowercase O with stroke (U+00F8, ø).
  • 238 (EEhex) is both the Greek lowercase epsilon (U+03B5, ε) and the element-of sign (U+2208, ∈). Later it was often used for the euro sign (U+20AC, €).

History

The repertoire of code page 437 was taken from the character set of Wang word-processing machines, according to Bill Gates in an interview with Gates and Paul Allen that appeared in the 2 October 1995 edition of Fortune Magazine:

"... We were also fascinated by dedicated word processors from Wang, because we believed that general-purpose machines could do that just as well. That's why, when it came time to design the keyboard for the IBM PC, we put the funny Wang character set into the machine—you know, smiley faces and boxes and triangles and stuff. We were thinking we'd like to do a clone of Wang word-processing software someday."

The selection of graphic characters has some internal logic:

  • Table rows 0 and 1, codes 0 to 31 (00hex to 1Fhex), are assorted dingbats (complementary and decorative characters). The isolated character 127 (7Fhex) also belongs to this group.
  • Table rows 2 to 7 (except character 127, 7Fhex), codes 32 to 126 (20hex to 7Ehex), are the standard ASCII printable characters.
  • Table rows 8 to 10 (8hex to Ahex), codes 128 to 175 (80hex to AFhex), are a selection of international text characters.
  • Table rows 11 to 13 (Bhex to Dhex), codes 176 to 223 (B0hex to DFhex), are box drawing and block characters. This block is arranged so that characters 192 to 223 (C0hex to DFhex) contain all the right arms and right-filled areas. The original IBM PC MDA display adapter stored the code page 437 character glyphs as bitmaps eight pixels wide, but for visual enhancement displayed them every nine pixels on screen. This range of characters had the eighth pixel column duplicated by special hardware circuitry,[8] thus filling in gaps in lines and filled areas.
  • Table rows 14 and 15 (Ehex and Fhex), codes 224 to 255 (E0hex to FFhex) are devoted to mathematical symbols, where the first twelve are a selection of Greek letters commonly used in physics. Characters 244 (F4hex) and 245 (F5hex) are the upper and lower portion of an italic long S, the symbol used as the integral sign (∫), and they can be extended with the character 179 (B3hex), the vertical line of the box drawing block. Character 244 could also be used as a surrogate for the ſ character. Characters 249 (F9hex) and 250 (FAhex) are almost indistinguishable: the first is slightly larger than the second, which resembles the typographic middle dot (·). The character 255 (FFhex) is merely blank, and acts as a kind of non-breaking space in order to arrange math formulae.

Most fonts for Microsoft Windows include the special graphic characters at the Unicode indexes shown, as they are part of the WGL4 set that Microsoft encourages font designers to support. (The monospaced raster font family Terminal was an early font that replicated all code page 437 characters, at least at some resolutions.) To draw these characters directly from these code points, a Microsoft Windows font called MS Linedraw[9] replicates all of the code page 437 characters, thus providing one way to display DOS text on a modern Windows machine as it was shown in DOS, with limitations.[10]

Internationalization

Code page 437 has a series of international characters, mainly values 128 to 175 (80hex to AFhex). However, it lacks several characters important to many Western languages:

  • Spanish (Á, Í, Ó, Ú), French (À, Â, È, Ê, Ë, Ì, Î, Ï, Ô, Œ, œ, Ù, Û), Portuguese (Á, À, Â, Ã, ã, Ê, Í, Ó, Ô, Õ, õ, Ú), and Catalan (À, È, Í, Ï, Ò, Ó, Ú).
  • German sharp S (ß) shares its code point with the beta symbol (β), which is acceptable at the low resolution on the original IBM CGA hardware, but unacceptable at higher resolutions. Most newer glyph sets for code page 437, including those built into the IBM EGA and VGA graphics cards, prefer the German sharp S shape for this character.
  • Scandinavian lacks slashed-o 'Ø' and 'ø'. Character number 237 (EDhex), the empty set symbol, could be used as a surrogate, but its spacing is awkward for display within a word. To compensate, the Danish/Norwegian and Icelandic code pages (865 and 861), replaced cent mark (¢) with 'ø' and yen (¥) with 'Ø'.
  • Most Greek alphabet symbols were omitted, beyond the basic math symbols. (They were included in the Greek-language code pages 737 and 869.)

Along with the cent (¢), pound sterling (£) and yen/yuan (¥) currency symbols, it has a couple of former European currency symbols: the florin (ƒ, Netherlands) and the peseta (₧, Spain). The presence of the last is unusual, since the Spanish peseta was never an internationally relevant currency, and also never had a symbol of its own; it was simply abbreviated as "Pt", "Pta", "Pts", or "Ptas". Spanish models of the IBM electric typewriter, however, also had a single position devoted to it.

Later MS-DOS character sets, such as code page 850 (DOS Latin-1), code page 852 (DOS Central-European) and code page 737 (DOS Greek), filled the gaps for international use with some compatibility with code page 437 by retaining the single and double box-drawing characters, while discarding the mixed ones (e.g. horizontal double/vertical single). All code page 437 characters have similar glyphs in Unicode and in Microsoft's WGL4 character set, and therefore are available in most fonts in Microsoft Windows, and also in the default VGA font of the Linux kernel, and the ISO 10646 fonts for X11.

See also

References

  1. ^ "OEM 437". Go Global Developer Center. Microsoft. Retrieved 22 September 2011.
  2. ^ a b "OEM font". Encyclopedia. PCmag.com. Retrieved 15 November 2011.
  3. ^ "Code Page 437 MS-DOS Latin US". Developing International Software. Microsoft. Retrieved 14 November 2011.
  4. ^ Systems available in Eastern European, Arabic, and Asian countries often use a different set. The designation "OEM", for "original equipment manufacturer", indicates that the "native" hardware character set supplied in ROM could be changed by the manufacturer to meet different markets.
  5. ^ "00437". Code pages by CPGID. IBM. Retrieved 14 November 2011.
  6. ^ "cp437_DOSLatinUS to Unicode table" (TXT). The Unicode Consortium. Retrieved 14 November 2011.
  7. ^ The Unicode Consortium, The Unicode Standard 4.0, Chapter 7, "European Alphabetic Scripts", p176. PDF version
  8. ^ Richard Wilton, Programmer's Guide to PC & PS/2 Video Systems, 1987, Microsoft Press.
  9. ^ Staff (2012). "MS LineDraw - Version 2.00". Microsoft. Microsoft Corporation. Retrieved 1 July 2012.
  10. ^ Staff (22 January 2007). WD97 "WD97: MS LineDraw Font Not Usable in Word". Microsoft. Microsoft. Retrieved 1 July 2012. {{cite web}}: Check |url= value (help)