ยปCore Development>Code coverage>Lib/encodings/hp_roman8.py

Python code coverage for Lib/encodings/hp_roman8.py

#countcontent
1n/a""" Python Character Mapping Codec generated from 'hp_roman8.txt' with gencodec.py.
2n/a
3n/a Based on data from ftp://dkuug.dk/i18n/charmaps/HP-ROMAN8 (Keld Simonsen)
4n/a
5n/a Original source: LaserJet IIP Printer User's Manual HP part no
6n/a 33471-90901, Hewlet-Packard, June 1989.
7n/a
8n/a (Used with permission)
9n/a
10n/a"""#"
11n/a
12n/aimport codecs
13n/a
14n/a### Codec APIs
15n/a
16n/aclass Codec(codecs.Codec):
17n/a
18n/a def encode(self,input,errors='strict'):
19n/a return codecs.charmap_encode(input,errors,encoding_table)
20n/a
21n/a def decode(self,input,errors='strict'):
22n/a return codecs.charmap_decode(input,errors,decoding_table)
23n/a
24n/aclass IncrementalEncoder(codecs.IncrementalEncoder):
25n/a def encode(self, input, final=False):
26n/a return codecs.charmap_encode(input,self.errors,encoding_table)[0]
27n/a
28n/aclass IncrementalDecoder(codecs.IncrementalDecoder):
29n/a def decode(self, input, final=False):
30n/a return codecs.charmap_decode(input,self.errors,decoding_table)[0]
31n/a
32n/aclass StreamWriter(Codec,codecs.StreamWriter):
33n/a pass
34n/a
35n/aclass StreamReader(Codec,codecs.StreamReader):
36n/a pass
37n/a
38n/a### encodings module API
39n/a
40n/adef getregentry():
41n/a return codecs.CodecInfo(
42n/a name='hp-roman8',
43n/a encode=Codec().encode,
44n/a decode=Codec().decode,
45n/a incrementalencoder=IncrementalEncoder,
46n/a incrementaldecoder=IncrementalDecoder,
47n/a streamwriter=StreamWriter,
48n/a streamreader=StreamReader,
49n/a )
50n/a
51n/a
52n/a### Decoding Table
53n/a
54n/adecoding_table = (
55n/a '\x00' # 0x00 -> NULL
56n/a '\x01' # 0x01 -> START OF HEADING
57n/a '\x02' # 0x02 -> START OF TEXT
58n/a '\x03' # 0x03 -> END OF TEXT
59n/a '\x04' # 0x04 -> END OF TRANSMISSION
60n/a '\x05' # 0x05 -> ENQUIRY
61n/a '\x06' # 0x06 -> ACKNOWLEDGE
62n/a '\x07' # 0x07 -> BELL
63n/a '\x08' # 0x08 -> BACKSPACE
64n/a '\t' # 0x09 -> HORIZONTAL TABULATION
65n/a '\n' # 0x0A -> LINE FEED
66n/a '\x0b' # 0x0B -> VERTICAL TABULATION
67n/a '\x0c' # 0x0C -> FORM FEED
68n/a '\r' # 0x0D -> CARRIAGE RETURN
69n/a '\x0e' # 0x0E -> SHIFT OUT
70n/a '\x0f' # 0x0F -> SHIFT IN
71n/a '\x10' # 0x10 -> DATA LINK ESCAPE
72n/a '\x11' # 0x11 -> DEVICE CONTROL ONE
73n/a '\x12' # 0x12 -> DEVICE CONTROL TWO
74n/a '\x13' # 0x13 -> DEVICE CONTROL THREE
75n/a '\x14' # 0x14 -> DEVICE CONTROL FOUR
76n/a '\x15' # 0x15 -> NEGATIVE ACKNOWLEDGE
77n/a '\x16' # 0x16 -> SYNCHRONOUS IDLE
78n/a '\x17' # 0x17 -> END OF TRANSMISSION BLOCK
79n/a '\x18' # 0x18 -> CANCEL
80n/a '\x19' # 0x19 -> END OF MEDIUM
81n/a '\x1a' # 0x1A -> SUBSTITUTE
82n/a '\x1b' # 0x1B -> ESCAPE
83n/a '\x1c' # 0x1C -> FILE SEPARATOR
84n/a '\x1d' # 0x1D -> GROUP SEPARATOR
85n/a '\x1e' # 0x1E -> RECORD SEPARATOR
86n/a '\x1f' # 0x1F -> UNIT SEPARATOR
87n/a ' ' # 0x20 -> SPACE
88n/a '!' # 0x21 -> EXCLAMATION MARK
89n/a '"' # 0x22 -> QUOTATION MARK
90n/a '#' # 0x23 -> NUMBER SIGN
91n/a '$' # 0x24 -> DOLLAR SIGN
92n/a '%' # 0x25 -> PERCENT SIGN
93n/a '&' # 0x26 -> AMPERSAND
94n/a "'" # 0x27 -> APOSTROPHE
95n/a '(' # 0x28 -> LEFT PARENTHESIS
96n/a ')' # 0x29 -> RIGHT PARENTHESIS
97n/a '*' # 0x2A -> ASTERISK
98n/a '+' # 0x2B -> PLUS SIGN
99n/a ',' # 0x2C -> COMMA
100n/a '-' # 0x2D -> HYPHEN-MINUS
101n/a '.' # 0x2E -> FULL STOP
102n/a '/' # 0x2F -> SOLIDUS
103n/a '0' # 0x30 -> DIGIT ZERO
104n/a '1' # 0x31 -> DIGIT ONE
105n/a '2' # 0x32 -> DIGIT TWO
106n/a '3' # 0x33 -> DIGIT THREE
107n/a '4' # 0x34 -> DIGIT FOUR
108n/a '5' # 0x35 -> DIGIT FIVE
109n/a '6' # 0x36 -> DIGIT SIX
110n/a '7' # 0x37 -> DIGIT SEVEN
111n/a '8' # 0x38 -> DIGIT EIGHT
112n/a '9' # 0x39 -> DIGIT NINE
113n/a ':' # 0x3A -> COLON
114n/a ';' # 0x3B -> SEMICOLON
115n/a '<' # 0x3C -> LESS-THAN SIGN
116n/a '=' # 0x3D -> EQUALS SIGN
117n/a '>' # 0x3E -> GREATER-THAN SIGN
118n/a '?' # 0x3F -> QUESTION MARK
119n/a '@' # 0x40 -> COMMERCIAL AT
120n/a 'A' # 0x41 -> LATIN CAPITAL LETTER A
121n/a 'B' # 0x42 -> LATIN CAPITAL LETTER B
122n/a 'C' # 0x43 -> LATIN CAPITAL LETTER C
123n/a 'D' # 0x44 -> LATIN CAPITAL LETTER D
124n/a 'E' # 0x45 -> LATIN CAPITAL LETTER E
125n/a 'F' # 0x46 -> LATIN CAPITAL LETTER F
126n/a 'G' # 0x47 -> LATIN CAPITAL LETTER G
127n/a 'H' # 0x48 -> LATIN CAPITAL LETTER H
128n/a 'I' # 0x49 -> LATIN CAPITAL LETTER I
129n/a 'J' # 0x4A -> LATIN CAPITAL LETTER J
130n/a 'K' # 0x4B -> LATIN CAPITAL LETTER K
131n/a 'L' # 0x4C -> LATIN CAPITAL LETTER L
132n/a 'M' # 0x4D -> LATIN CAPITAL LETTER M
133n/a 'N' # 0x4E -> LATIN CAPITAL LETTER N
134n/a 'O' # 0x4F -> LATIN CAPITAL LETTER O
135n/a 'P' # 0x50 -> LATIN CAPITAL LETTER P
136n/a 'Q' # 0x51 -> LATIN CAPITAL LETTER Q
137n/a 'R' # 0x52 -> LATIN CAPITAL LETTER R
138n/a 'S' # 0x53 -> LATIN CAPITAL LETTER S
139n/a 'T' # 0x54 -> LATIN CAPITAL LETTER T
140n/a 'U' # 0x55 -> LATIN CAPITAL LETTER U
141n/a 'V' # 0x56 -> LATIN CAPITAL LETTER V
142n/a 'W' # 0x57 -> LATIN CAPITAL LETTER W
143n/a 'X' # 0x58 -> LATIN CAPITAL LETTER X
144n/a 'Y' # 0x59 -> LATIN CAPITAL LETTER Y
145n/a 'Z' # 0x5A -> LATIN CAPITAL LETTER Z
146n/a '[' # 0x5B -> LEFT SQUARE BRACKET
147n/a '\\' # 0x5C -> REVERSE SOLIDUS
148n/a ']' # 0x5D -> RIGHT SQUARE BRACKET
149n/a '^' # 0x5E -> CIRCUMFLEX ACCENT
150n/a '_' # 0x5F -> LOW LINE
151n/a '`' # 0x60 -> GRAVE ACCENT
152n/a 'a' # 0x61 -> LATIN SMALL LETTER A
153n/a 'b' # 0x62 -> LATIN SMALL LETTER B
154n/a 'c' # 0x63 -> LATIN SMALL LETTER C
155n/a 'd' # 0x64 -> LATIN SMALL LETTER D
156n/a 'e' # 0x65 -> LATIN SMALL LETTER E
157n/a 'f' # 0x66 -> LATIN SMALL LETTER F
158n/a 'g' # 0x67 -> LATIN SMALL LETTER G
159n/a 'h' # 0x68 -> LATIN SMALL LETTER H
160n/a 'i' # 0x69 -> LATIN SMALL LETTER I
161n/a 'j' # 0x6A -> LATIN SMALL LETTER J
162n/a 'k' # 0x6B -> LATIN SMALL LETTER K
163n/a 'l' # 0x6C -> LATIN SMALL LETTER L
164n/a 'm' # 0x6D -> LATIN SMALL LETTER M
165n/a 'n' # 0x6E -> LATIN SMALL LETTER N
166n/a 'o' # 0x6F -> LATIN SMALL LETTER O
167n/a 'p' # 0x70 -> LATIN SMALL LETTER P
168n/a 'q' # 0x71 -> LATIN SMALL LETTER Q
169n/a 'r' # 0x72 -> LATIN SMALL LETTER R
170n/a 's' # 0x73 -> LATIN SMALL LETTER S
171n/a 't' # 0x74 -> LATIN SMALL LETTER T
172n/a 'u' # 0x75 -> LATIN SMALL LETTER U
173n/a 'v' # 0x76 -> LATIN SMALL LETTER V
174n/a 'w' # 0x77 -> LATIN SMALL LETTER W
175n/a 'x' # 0x78 -> LATIN SMALL LETTER X
176n/a 'y' # 0x79 -> LATIN SMALL LETTER Y
177n/a 'z' # 0x7A -> LATIN SMALL LETTER Z
178n/a '{' # 0x7B -> LEFT CURLY BRACKET
179n/a '|' # 0x7C -> VERTICAL LINE
180n/a '}' # 0x7D -> RIGHT CURLY BRACKET
181n/a '~' # 0x7E -> TILDE
182n/a '\x7f' # 0x7F -> DELETE
183n/a '\x80' # 0x80 -> <control>
184n/a '\x81' # 0x81 -> <control>
185n/a '\x82' # 0x82 -> <control>
186n/a '\x83' # 0x83 -> <control>
187n/a '\x84' # 0x84 -> <control>
188n/a '\x85' # 0x85 -> <control>
189n/a '\x86' # 0x86 -> <control>
190n/a '\x87' # 0x87 -> <control>
191n/a '\x88' # 0x88 -> <control>
192n/a '\x89' # 0x89 -> <control>
193n/a '\x8a' # 0x8A -> <control>
194n/a '\x8b' # 0x8B -> <control>
195n/a '\x8c' # 0x8C -> <control>
196n/a '\x8d' # 0x8D -> <control>
197n/a '\x8e' # 0x8E -> <control>
198n/a '\x8f' # 0x8F -> <control>
199n/a '\x90' # 0x90 -> <control>
200n/a '\x91' # 0x91 -> <control>
201n/a '\x92' # 0x92 -> <control>
202n/a '\x93' # 0x93 -> <control>
203n/a '\x94' # 0x94 -> <control>
204n/a '\x95' # 0x95 -> <control>
205n/a '\x96' # 0x96 -> <control>
206n/a '\x97' # 0x97 -> <control>
207n/a '\x98' # 0x98 -> <control>
208n/a '\x99' # 0x99 -> <control>
209n/a '\x9a' # 0x9A -> <control>
210n/a '\x9b' # 0x9B -> <control>
211n/a '\x9c' # 0x9C -> <control>
212n/a '\x9d' # 0x9D -> <control>
213n/a '\x9e' # 0x9E -> <control>
214n/a '\x9f' # 0x9F -> <control>
215n/a '\xa0' # 0xA0 -> NO-BREAK SPACE
216n/a '\xc0' # 0xA1 -> LATIN CAPITAL LETTER A WITH GRAVE
217n/a '\xc2' # 0xA2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
218n/a '\xc8' # 0xA3 -> LATIN CAPITAL LETTER E WITH GRAVE
219n/a '\xca' # 0xA4 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
220n/a '\xcb' # 0xA5 -> LATIN CAPITAL LETTER E WITH DIAERESIS
221n/a '\xce' # 0xA6 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
222n/a '\xcf' # 0xA7 -> LATIN CAPITAL LETTER I WITH DIAERESIS
223n/a '\xb4' # 0xA8 -> ACUTE ACCENT
224n/a '\u02cb' # 0xA9 -> MODIFIER LETTER GRAVE ACCENT (MANDARIN CHINESE FOURTH TONE)
225n/a '\u02c6' # 0xAA -> MODIFIER LETTER CIRCUMFLEX ACCENT
226n/a '\xa8' # 0xAB -> DIAERESIS
227n/a '\u02dc' # 0xAC -> SMALL TILDE
228n/a '\xd9' # 0xAD -> LATIN CAPITAL LETTER U WITH GRAVE
229n/a '\xdb' # 0xAE -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
230n/a '\u20a4' # 0xAF -> LIRA SIGN
231n/a '\xaf' # 0xB0 -> MACRON
232n/a '\xdd' # 0xB1 -> LATIN CAPITAL LETTER Y WITH ACUTE
233n/a '\xfd' # 0xB2 -> LATIN SMALL LETTER Y WITH ACUTE
234n/a '\xb0' # 0xB3 -> DEGREE SIGN
235n/a '\xc7' # 0xB4 -> LATIN CAPITAL LETTER C WITH CEDILLA
236n/a '\xe7' # 0xB5 -> LATIN SMALL LETTER C WITH CEDILLA
237n/a '\xd1' # 0xB6 -> LATIN CAPITAL LETTER N WITH TILDE
238n/a '\xf1' # 0xB7 -> LATIN SMALL LETTER N WITH TILDE
239n/a '\xa1' # 0xB8 -> INVERTED EXCLAMATION MARK
240n/a '\xbf' # 0xB9 -> INVERTED QUESTION MARK
241n/a '\xa4' # 0xBA -> CURRENCY SIGN
242n/a '\xa3' # 0xBB -> POUND SIGN
243n/a '\xa5' # 0xBC -> YEN SIGN
244n/a '\xa7' # 0xBD -> SECTION SIGN
245n/a '\u0192' # 0xBE -> LATIN SMALL LETTER F WITH HOOK
246n/a '\xa2' # 0xBF -> CENT SIGN
247n/a '\xe2' # 0xC0 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
248n/a '\xea' # 0xC1 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
249n/a '\xf4' # 0xC2 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
250n/a '\xfb' # 0xC3 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
251n/a '\xe1' # 0xC4 -> LATIN SMALL LETTER A WITH ACUTE
252n/a '\xe9' # 0xC5 -> LATIN SMALL LETTER E WITH ACUTE
253n/a '\xf3' # 0xC6 -> LATIN SMALL LETTER O WITH ACUTE
254n/a '\xfa' # 0xC7 -> LATIN SMALL LETTER U WITH ACUTE
255n/a '\xe0' # 0xC8 -> LATIN SMALL LETTER A WITH GRAVE
256n/a '\xe8' # 0xC9 -> LATIN SMALL LETTER E WITH GRAVE
257n/a '\xf2' # 0xCA -> LATIN SMALL LETTER O WITH GRAVE
258n/a '\xf9' # 0xCB -> LATIN SMALL LETTER U WITH GRAVE
259n/a '\xe4' # 0xCC -> LATIN SMALL LETTER A WITH DIAERESIS
260n/a '\xeb' # 0xCD -> LATIN SMALL LETTER E WITH DIAERESIS
261n/a '\xf6' # 0xCE -> LATIN SMALL LETTER O WITH DIAERESIS
262n/a '\xfc' # 0xCF -> LATIN SMALL LETTER U WITH DIAERESIS
263n/a '\xc5' # 0xD0 -> LATIN CAPITAL LETTER A WITH RING ABOVE
264n/a '\xee' # 0xD1 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
265n/a '\xd8' # 0xD2 -> LATIN CAPITAL LETTER O WITH STROKE
266n/a '\xc6' # 0xD3 -> LATIN CAPITAL LETTER AE
267n/a '\xe5' # 0xD4 -> LATIN SMALL LETTER A WITH RING ABOVE
268n/a '\xed' # 0xD5 -> LATIN SMALL LETTER I WITH ACUTE
269n/a '\xf8' # 0xD6 -> LATIN SMALL LETTER O WITH STROKE
270n/a '\xe6' # 0xD7 -> LATIN SMALL LETTER AE
271n/a '\xc4' # 0xD8 -> LATIN CAPITAL LETTER A WITH DIAERESIS
272n/a '\xec' # 0xD9 -> LATIN SMALL LETTER I WITH GRAVE
273n/a '\xd6' # 0xDA -> LATIN CAPITAL LETTER O WITH DIAERESIS
274n/a '\xdc' # 0xDB -> LATIN CAPITAL LETTER U WITH DIAERESIS
275n/a '\xc9' # 0xDC -> LATIN CAPITAL LETTER E WITH ACUTE
276n/a '\xef' # 0xDD -> LATIN SMALL LETTER I WITH DIAERESIS
277n/a '\xdf' # 0xDE -> LATIN SMALL LETTER SHARP S (GERMAN)
278n/a '\xd4' # 0xDF -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
279n/a '\xc1' # 0xE0 -> LATIN CAPITAL LETTER A WITH ACUTE
280n/a '\xc3' # 0xE1 -> LATIN CAPITAL LETTER A WITH TILDE
281n/a '\xe3' # 0xE2 -> LATIN SMALL LETTER A WITH TILDE
282n/a '\xd0' # 0xE3 -> LATIN CAPITAL LETTER ETH (ICELANDIC)
283n/a '\xf0' # 0xE4 -> LATIN SMALL LETTER ETH (ICELANDIC)
284n/a '\xcd' # 0xE5 -> LATIN CAPITAL LETTER I WITH ACUTE
285n/a '\xcc' # 0xE6 -> LATIN CAPITAL LETTER I WITH GRAVE
286n/a '\xd3' # 0xE7 -> LATIN CAPITAL LETTER O WITH ACUTE
287n/a '\xd2' # 0xE8 -> LATIN CAPITAL LETTER O WITH GRAVE
288n/a '\xd5' # 0xE9 -> LATIN CAPITAL LETTER O WITH TILDE
289n/a '\xf5' # 0xEA -> LATIN SMALL LETTER O WITH TILDE
290n/a '\u0160' # 0xEB -> LATIN CAPITAL LETTER S WITH CARON
291n/a '\u0161' # 0xEC -> LATIN SMALL LETTER S WITH CARON
292n/a '\xda' # 0xED -> LATIN CAPITAL LETTER U WITH ACUTE
293n/a '\u0178' # 0xEE -> LATIN CAPITAL LETTER Y WITH DIAERESIS
294n/a '\xff' # 0xEF -> LATIN SMALL LETTER Y WITH DIAERESIS
295n/a '\xde' # 0xF0 -> LATIN CAPITAL LETTER THORN (ICELANDIC)
296n/a '\xfe' # 0xF1 -> LATIN SMALL LETTER THORN (ICELANDIC)
297n/a '\xb7' # 0xF2 -> MIDDLE DOT
298n/a '\xb5' # 0xF3 -> MICRO SIGN
299n/a '\xb6' # 0xF4 -> PILCROW SIGN
300n/a '\xbe' # 0xF5 -> VULGAR FRACTION THREE QUARTERS
301n/a '\u2014' # 0xF6 -> EM DASH
302n/a '\xbc' # 0xF7 -> VULGAR FRACTION ONE QUARTER
303n/a '\xbd' # 0xF8 -> VULGAR FRACTION ONE HALF
304n/a '\xaa' # 0xF9 -> FEMININE ORDINAL INDICATOR
305n/a '\xba' # 0xFA -> MASCULINE ORDINAL INDICATOR
306n/a '\xab' # 0xFB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
307n/a '\u25a0' # 0xFC -> BLACK SQUARE
308n/a '\xbb' # 0xFD -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
309n/a '\xb1' # 0xFE -> PLUS-MINUS SIGN
310n/a '\ufffe'
311n/a)
312n/a
313n/a### Encoding table
314n/aencoding_table=codecs.charmap_build(decoding_table)