»Core Development>Code coverage>Lib/encodings/koi8_t.py

Python code coverage for Lib/encodings/koi8_t.py

#countcontent
1n/a""" Python Character Mapping Codec koi8_t
2n/a"""
3n/a# http://ru.wikipedia.org/wiki/КОИ-8
4n/a# http://www.opensource.apple.com/source/libiconv/libiconv-4/libiconv/tests/KOI8-T.TXT
5n/a
6n/aimport codecs
7n/a
8n/a### Codec APIs
9n/a
10n/aclass Codec(codecs.Codec):
11n/a
12n/a def encode(self,input,errors='strict'):
13n/a return codecs.charmap_encode(input,errors,encoding_table)
14n/a
15n/a def decode(self,input,errors='strict'):
16n/a return codecs.charmap_decode(input,errors,decoding_table)
17n/a
18n/aclass IncrementalEncoder(codecs.IncrementalEncoder):
19n/a def encode(self, input, final=False):
20n/a return codecs.charmap_encode(input,self.errors,encoding_table)[0]
21n/a
22n/aclass IncrementalDecoder(codecs.IncrementalDecoder):
23n/a def decode(self, input, final=False):
24n/a return codecs.charmap_decode(input,self.errors,decoding_table)[0]
25n/a
26n/aclass StreamWriter(Codec,codecs.StreamWriter):
27n/a pass
28n/a
29n/aclass StreamReader(Codec,codecs.StreamReader):
30n/a pass
31n/a
32n/a### encodings module API
33n/a
34n/adef getregentry():
35n/a return codecs.CodecInfo(
36n/a name='koi8-t',
37n/a encode=Codec().encode,
38n/a decode=Codec().decode,
39n/a incrementalencoder=IncrementalEncoder,
40n/a incrementaldecoder=IncrementalDecoder,
41n/a streamreader=StreamReader,
42n/a streamwriter=StreamWriter,
43n/a )
44n/a
45n/a
46n/a### Decoding Table
47n/a
48n/adecoding_table = (
49n/a '\x00' # 0x00 -> NULL
50n/a '\x01' # 0x01 -> START OF HEADING
51n/a '\x02' # 0x02 -> START OF TEXT
52n/a '\x03' # 0x03 -> END OF TEXT
53n/a '\x04' # 0x04 -> END OF TRANSMISSION
54n/a '\x05' # 0x05 -> ENQUIRY
55n/a '\x06' # 0x06 -> ACKNOWLEDGE
56n/a '\x07' # 0x07 -> BELL
57n/a '\x08' # 0x08 -> BACKSPACE
58n/a '\t' # 0x09 -> HORIZONTAL TABULATION
59n/a '\n' # 0x0A -> LINE FEED
60n/a '\x0b' # 0x0B -> VERTICAL TABULATION
61n/a '\x0c' # 0x0C -> FORM FEED
62n/a '\r' # 0x0D -> CARRIAGE RETURN
63n/a '\x0e' # 0x0E -> SHIFT OUT
64n/a '\x0f' # 0x0F -> SHIFT IN
65n/a '\x10' # 0x10 -> DATA LINK ESCAPE
66n/a '\x11' # 0x11 -> DEVICE CONTROL ONE
67n/a '\x12' # 0x12 -> DEVICE CONTROL TWO
68n/a '\x13' # 0x13 -> DEVICE CONTROL THREE
69n/a '\x14' # 0x14 -> DEVICE CONTROL FOUR
70n/a '\x15' # 0x15 -> NEGATIVE ACKNOWLEDGE
71n/a '\x16' # 0x16 -> SYNCHRONOUS IDLE
72n/a '\x17' # 0x17 -> END OF TRANSMISSION BLOCK
73n/a '\x18' # 0x18 -> CANCEL
74n/a '\x19' # 0x19 -> END OF MEDIUM
75n/a '\x1a' # 0x1A -> SUBSTITUTE
76n/a '\x1b' # 0x1B -> ESCAPE
77n/a '\x1c' # 0x1C -> FILE SEPARATOR
78n/a '\x1d' # 0x1D -> GROUP SEPARATOR
79n/a '\x1e' # 0x1E -> RECORD SEPARATOR
80n/a '\x1f' # 0x1F -> UNIT SEPARATOR
81n/a ' ' # 0x20 -> SPACE
82n/a '!' # 0x21 -> EXCLAMATION MARK
83n/a '"' # 0x22 -> QUOTATION MARK
84n/a '#' # 0x23 -> NUMBER SIGN
85n/a '$' # 0x24 -> DOLLAR SIGN
86n/a '%' # 0x25 -> PERCENT SIGN
87n/a '&' # 0x26 -> AMPERSAND
88n/a "'" # 0x27 -> APOSTROPHE
89n/a '(' # 0x28 -> LEFT PARENTHESIS
90n/a ')' # 0x29 -> RIGHT PARENTHESIS
91n/a '*' # 0x2A -> ASTERISK
92n/a '+' # 0x2B -> PLUS SIGN
93n/a ',' # 0x2C -> COMMA
94n/a '-' # 0x2D -> HYPHEN-MINUS
95n/a '.' # 0x2E -> FULL STOP
96n/a '/' # 0x2F -> SOLIDUS
97n/a '0' # 0x30 -> DIGIT ZERO
98n/a '1' # 0x31 -> DIGIT ONE
99n/a '2' # 0x32 -> DIGIT TWO
100n/a '3' # 0x33 -> DIGIT THREE
101n/a '4' # 0x34 -> DIGIT FOUR
102n/a '5' # 0x35 -> DIGIT FIVE
103n/a '6' # 0x36 -> DIGIT SIX
104n/a '7' # 0x37 -> DIGIT SEVEN
105n/a '8' # 0x38 -> DIGIT EIGHT
106n/a '9' # 0x39 -> DIGIT NINE
107n/a ':' # 0x3A -> COLON
108n/a ';' # 0x3B -> SEMICOLON
109n/a '<' # 0x3C -> LESS-THAN SIGN
110n/a '=' # 0x3D -> EQUALS SIGN
111n/a '>' # 0x3E -> GREATER-THAN SIGN
112n/a '?' # 0x3F -> QUESTION MARK
113n/a '@' # 0x40 -> COMMERCIAL AT
114n/a 'A' # 0x41 -> LATIN CAPITAL LETTER A
115n/a 'B' # 0x42 -> LATIN CAPITAL LETTER B
116n/a 'C' # 0x43 -> LATIN CAPITAL LETTER C
117n/a 'D' # 0x44 -> LATIN CAPITAL LETTER D
118n/a 'E' # 0x45 -> LATIN CAPITAL LETTER E
119n/a 'F' # 0x46 -> LATIN CAPITAL LETTER F
120n/a 'G' # 0x47 -> LATIN CAPITAL LETTER G
121n/a 'H' # 0x48 -> LATIN CAPITAL LETTER H
122n/a 'I' # 0x49 -> LATIN CAPITAL LETTER I
123n/a 'J' # 0x4A -> LATIN CAPITAL LETTER J
124n/a 'K' # 0x4B -> LATIN CAPITAL LETTER K
125n/a 'L' # 0x4C -> LATIN CAPITAL LETTER L
126n/a 'M' # 0x4D -> LATIN CAPITAL LETTER M
127n/a 'N' # 0x4E -> LATIN CAPITAL LETTER N
128n/a 'O' # 0x4F -> LATIN CAPITAL LETTER O
129n/a 'P' # 0x50 -> LATIN CAPITAL LETTER P
130n/a 'Q' # 0x51 -> LATIN CAPITAL LETTER Q
131n/a 'R' # 0x52 -> LATIN CAPITAL LETTER R
132n/a 'S' # 0x53 -> LATIN CAPITAL LETTER S
133n/a 'T' # 0x54 -> LATIN CAPITAL LETTER T
134n/a 'U' # 0x55 -> LATIN CAPITAL LETTER U
135n/a 'V' # 0x56 -> LATIN CAPITAL LETTER V
136n/a 'W' # 0x57 -> LATIN CAPITAL LETTER W
137n/a 'X' # 0x58 -> LATIN CAPITAL LETTER X
138n/a 'Y' # 0x59 -> LATIN CAPITAL LETTER Y
139n/a 'Z' # 0x5A -> LATIN CAPITAL LETTER Z
140n/a '[' # 0x5B -> LEFT SQUARE BRACKET
141n/a '\\' # 0x5C -> REVERSE SOLIDUS
142n/a ']' # 0x5D -> RIGHT SQUARE BRACKET
143n/a '^' # 0x5E -> CIRCUMFLEX ACCENT
144n/a '_' # 0x5F -> LOW LINE
145n/a '`' # 0x60 -> GRAVE ACCENT
146n/a 'a' # 0x61 -> LATIN SMALL LETTER A
147n/a 'b' # 0x62 -> LATIN SMALL LETTER B
148n/a 'c' # 0x63 -> LATIN SMALL LETTER C
149n/a 'd' # 0x64 -> LATIN SMALL LETTER D
150n/a 'e' # 0x65 -> LATIN SMALL LETTER E
151n/a 'f' # 0x66 -> LATIN SMALL LETTER F
152n/a 'g' # 0x67 -> LATIN SMALL LETTER G
153n/a 'h' # 0x68 -> LATIN SMALL LETTER H
154n/a 'i' # 0x69 -> LATIN SMALL LETTER I
155n/a 'j' # 0x6A -> LATIN SMALL LETTER J
156n/a 'k' # 0x6B -> LATIN SMALL LETTER K
157n/a 'l' # 0x6C -> LATIN SMALL LETTER L
158n/a 'm' # 0x6D -> LATIN SMALL LETTER M
159n/a 'n' # 0x6E -> LATIN SMALL LETTER N
160n/a 'o' # 0x6F -> LATIN SMALL LETTER O
161n/a 'p' # 0x70 -> LATIN SMALL LETTER P
162n/a 'q' # 0x71 -> LATIN SMALL LETTER Q
163n/a 'r' # 0x72 -> LATIN SMALL LETTER R
164n/a 's' # 0x73 -> LATIN SMALL LETTER S
165n/a 't' # 0x74 -> LATIN SMALL LETTER T
166n/a 'u' # 0x75 -> LATIN SMALL LETTER U
167n/a 'v' # 0x76 -> LATIN SMALL LETTER V
168n/a 'w' # 0x77 -> LATIN SMALL LETTER W
169n/a 'x' # 0x78 -> LATIN SMALL LETTER X
170n/a 'y' # 0x79 -> LATIN SMALL LETTER Y
171n/a 'z' # 0x7A -> LATIN SMALL LETTER Z
172n/a '{' # 0x7B -> LEFT CURLY BRACKET
173n/a '|' # 0x7C -> VERTICAL LINE
174n/a '}' # 0x7D -> RIGHT CURLY BRACKET
175n/a '~' # 0x7E -> TILDE
176n/a '\x7f' # 0x7F -> DELETE
177n/a '\u049b' # 0x80 -> CYRILLIC SMALL LETTER KA WITH DESCENDER
178n/a '\u0493' # 0x81 -> CYRILLIC SMALL LETTER GHE WITH STROKE
179n/a '\u201a' # 0x82 -> SINGLE LOW-9 QUOTATION MARK
180n/a '\u0492' # 0x83 -> CYRILLIC CAPITAL LETTER GHE WITH STROKE
181n/a '\u201e' # 0x84 -> DOUBLE LOW-9 QUOTATION MARK
182n/a '\u2026' # 0x85 -> HORIZONTAL ELLIPSIS
183n/a '\u2020' # 0x86 -> DAGGER
184n/a '\u2021' # 0x87 -> DOUBLE DAGGER
185n/a '\ufffe' # 0x88 -> UNDEFINED
186n/a '\u2030' # 0x89 -> PER MILLE SIGN
187n/a '\u04b3' # 0x8A -> CYRILLIC SMALL LETTER HA WITH DESCENDER
188n/a '\u2039' # 0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
189n/a '\u04b2' # 0x8C -> CYRILLIC CAPITAL LETTER HA WITH DESCENDER
190n/a '\u04b7' # 0x8D -> CYRILLIC SMALL LETTER CHE WITH DESCENDER
191n/a '\u04b6' # 0x8E -> CYRILLIC CAPITAL LETTER CHE WITH DESCENDER
192n/a '\ufffe' # 0x8F -> UNDEFINED
193n/a '\u049a' # 0x90 -> CYRILLIC CAPITAL LETTER KA WITH DESCENDER
194n/a '\u2018' # 0x91 -> LEFT SINGLE QUOTATION MARK
195n/a '\u2019' # 0x92 -> RIGHT SINGLE QUOTATION MARK
196n/a '\u201c' # 0x93 -> LEFT DOUBLE QUOTATION MARK
197n/a '\u201d' # 0x94 -> RIGHT DOUBLE QUOTATION MARK
198n/a '\u2022' # 0x95 -> BULLET
199n/a '\u2013' # 0x96 -> EN DASH
200n/a '\u2014' # 0x97 -> EM DASH
201n/a '\ufffe' # 0x98 -> UNDEFINED
202n/a '\u2122' # 0x99 -> TRADE MARK SIGN
203n/a '\ufffe' # 0x9A -> UNDEFINED
204n/a '\u203a' # 0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
205n/a '\ufffe' # 0x9C -> UNDEFINED
206n/a '\ufffe' # 0x9D -> UNDEFINED
207n/a '\ufffe' # 0x9E -> UNDEFINED
208n/a '\ufffe' # 0x9F -> UNDEFINED
209n/a '\ufffe' # 0xA0 -> UNDEFINED
210n/a '\u04ef' # 0xA1 -> CYRILLIC SMALL LETTER U WITH MACRON
211n/a '\u04ee' # 0xA2 -> CYRILLIC CAPITAL LETTER U WITH MACRON
212n/a '\u0451' # 0xA3 -> CYRILLIC SMALL LETTER IO
213n/a '\xa4' # 0xA4 -> CURRENCY SIGN
214n/a '\u04e3' # 0xA5 -> CYRILLIC SMALL LETTER I WITH MACRON
215n/a '\xa6' # 0xA6 -> BROKEN BAR
216n/a '\xa7' # 0xA7 -> SECTION SIGN
217n/a '\ufffe' # 0xA8 -> UNDEFINED
218n/a '\ufffe' # 0xA9 -> UNDEFINED
219n/a '\ufffe' # 0xAA -> UNDEFINED
220n/a '\xab' # 0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
221n/a '\xac' # 0xAC -> NOT SIGN
222n/a '\xad' # 0xAD -> SOFT HYPHEN
223n/a '\xae' # 0xAE -> REGISTERED SIGN
224n/a '\ufffe' # 0xAF -> UNDEFINED
225n/a '\xb0' # 0xB0 -> DEGREE SIGN
226n/a '\xb1' # 0xB1 -> PLUS-MINUS SIGN
227n/a '\xb2' # 0xB2 -> SUPERSCRIPT TWO
228n/a '\u0401' # 0xB3 -> CYRILLIC CAPITAL LETTER IO
229n/a '\ufffe' # 0xB4 -> UNDEFINED
230n/a '\u04e2' # 0xB5 -> CYRILLIC CAPITAL LETTER I WITH MACRON
231n/a '\xb6' # 0xB6 -> PILCROW SIGN
232n/a '\xb7' # 0xB7 -> MIDDLE DOT
233n/a '\ufffe' # 0xB8 -> UNDEFINED
234n/a '\u2116' # 0xB9 -> NUMERO SIGN
235n/a '\ufffe' # 0xBA -> UNDEFINED
236n/a '\xbb' # 0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
237n/a '\ufffe' # 0xBC -> UNDEFINED
238n/a '\ufffe' # 0xBD -> UNDEFINED
239n/a '\ufffe' # 0xBE -> UNDEFINED
240n/a '\xa9' # 0xBF -> COPYRIGHT SIGN
241n/a '\u044e' # 0xC0 -> CYRILLIC SMALL LETTER YU
242n/a '\u0430' # 0xC1 -> CYRILLIC SMALL LETTER A
243n/a '\u0431' # 0xC2 -> CYRILLIC SMALL LETTER BE
244n/a '\u0446' # 0xC3 -> CYRILLIC SMALL LETTER TSE
245n/a '\u0434' # 0xC4 -> CYRILLIC SMALL LETTER DE
246n/a '\u0435' # 0xC5 -> CYRILLIC SMALL LETTER IE
247n/a '\u0444' # 0xC6 -> CYRILLIC SMALL LETTER EF
248n/a '\u0433' # 0xC7 -> CYRILLIC SMALL LETTER GHE
249n/a '\u0445' # 0xC8 -> CYRILLIC SMALL LETTER HA
250n/a '\u0438' # 0xC9 -> CYRILLIC SMALL LETTER I
251n/a '\u0439' # 0xCA -> CYRILLIC SMALL LETTER SHORT I
252n/a '\u043a' # 0xCB -> CYRILLIC SMALL LETTER KA
253n/a '\u043b' # 0xCC -> CYRILLIC SMALL LETTER EL
254n/a '\u043c' # 0xCD -> CYRILLIC SMALL LETTER EM
255n/a '\u043d' # 0xCE -> CYRILLIC SMALL LETTER EN
256n/a '\u043e' # 0xCF -> CYRILLIC SMALL LETTER O
257n/a '\u043f' # 0xD0 -> CYRILLIC SMALL LETTER PE
258n/a '\u044f' # 0xD1 -> CYRILLIC SMALL LETTER YA
259n/a '\u0440' # 0xD2 -> CYRILLIC SMALL LETTER ER
260n/a '\u0441' # 0xD3 -> CYRILLIC SMALL LETTER ES
261n/a '\u0442' # 0xD4 -> CYRILLIC SMALL LETTER TE
262n/a '\u0443' # 0xD5 -> CYRILLIC SMALL LETTER U
263n/a '\u0436' # 0xD6 -> CYRILLIC SMALL LETTER ZHE
264n/a '\u0432' # 0xD7 -> CYRILLIC SMALL LETTER VE
265n/a '\u044c' # 0xD8 -> CYRILLIC SMALL LETTER SOFT SIGN
266n/a '\u044b' # 0xD9 -> CYRILLIC SMALL LETTER YERU
267n/a '\u0437' # 0xDA -> CYRILLIC SMALL LETTER ZE
268n/a '\u0448' # 0xDB -> CYRILLIC SMALL LETTER SHA
269n/a '\u044d' # 0xDC -> CYRILLIC SMALL LETTER E
270n/a '\u0449' # 0xDD -> CYRILLIC SMALL LETTER SHCHA
271n/a '\u0447' # 0xDE -> CYRILLIC SMALL LETTER CHE
272n/a '\u044a' # 0xDF -> CYRILLIC SMALL LETTER HARD SIGN
273n/a '\u042e' # 0xE0 -> CYRILLIC CAPITAL LETTER YU
274n/a '\u0410' # 0xE1 -> CYRILLIC CAPITAL LETTER A
275n/a '\u0411' # 0xE2 -> CYRILLIC CAPITAL LETTER BE
276n/a '\u0426' # 0xE3 -> CYRILLIC CAPITAL LETTER TSE
277n/a '\u0414' # 0xE4 -> CYRILLIC CAPITAL LETTER DE
278n/a '\u0415' # 0xE5 -> CYRILLIC CAPITAL LETTER IE
279n/a '\u0424' # 0xE6 -> CYRILLIC CAPITAL LETTER EF
280n/a '\u0413' # 0xE7 -> CYRILLIC CAPITAL LETTER GHE
281n/a '\u0425' # 0xE8 -> CYRILLIC CAPITAL LETTER HA
282n/a '\u0418' # 0xE9 -> CYRILLIC CAPITAL LETTER I
283n/a '\u0419' # 0xEA -> CYRILLIC CAPITAL LETTER SHORT I
284n/a '\u041a' # 0xEB -> CYRILLIC CAPITAL LETTER KA
285n/a '\u041b' # 0xEC -> CYRILLIC CAPITAL LETTER EL
286n/a '\u041c' # 0xED -> CYRILLIC CAPITAL LETTER EM
287n/a '\u041d' # 0xEE -> CYRILLIC CAPITAL LETTER EN
288n/a '\u041e' # 0xEF -> CYRILLIC CAPITAL LETTER O
289n/a '\u041f' # 0xF0 -> CYRILLIC CAPITAL LETTER PE
290n/a '\u042f' # 0xF1 -> CYRILLIC CAPITAL LETTER YA
291n/a '\u0420' # 0xF2 -> CYRILLIC CAPITAL LETTER ER
292n/a '\u0421' # 0xF3 -> CYRILLIC CAPITAL LETTER ES
293n/a '\u0422' # 0xF4 -> CYRILLIC CAPITAL LETTER TE
294n/a '\u0423' # 0xF5 -> CYRILLIC CAPITAL LETTER U
295n/a '\u0416' # 0xF6 -> CYRILLIC CAPITAL LETTER ZHE
296n/a '\u0412' # 0xF7 -> CYRILLIC CAPITAL LETTER VE
297n/a '\u042c' # 0xF8 -> CYRILLIC CAPITAL LETTER SOFT SIGN
298n/a '\u042b' # 0xF9 -> CYRILLIC CAPITAL LETTER YERU
299n/a '\u0417' # 0xFA -> CYRILLIC CAPITAL LETTER ZE
300n/a '\u0428' # 0xFB -> CYRILLIC CAPITAL LETTER SHA
301n/a '\u042d' # 0xFC -> CYRILLIC CAPITAL LETTER E
302n/a '\u0429' # 0xFD -> CYRILLIC CAPITAL LETTER SHCHA
303n/a '\u0427' # 0xFE -> CYRILLIC CAPITAL LETTER CHE
304n/a '\u042a' # 0xFF -> CYRILLIC CAPITAL LETTER HARD SIGN
305n/a)
306n/a
307n/a### Encoding table
308n/aencoding_table=codecs.charmap_build(decoding_table)