Marc-André Lemburg | 3c72ded | 2005-10-24 12:07:49 +0000 | [diff] [blame] | 1 | """ Python Character Mapping Codec generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.TXT' with gencodec.py. |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 2 | |
| 3 | """#" |
| 4 | |
| 5 | import codecs |
| 6 | |
| 7 | ### Codec APIs |
| 8 | |
| 9 | class Codec(codecs.Codec): |
| 10 | |
| 11 | def encode(self,input,errors='strict'): |
| 12 | |
| 13 | return codecs.charmap_encode(input,errors,encoding_map) |
Tim Peters | 469cdad | 2002-08-08 20:19:19 +0000 | [diff] [blame] | 14 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 15 | def decode(self,input,errors='strict'): |
| 16 | |
Marc-André Lemburg | a1129f4 | 2005-10-21 13:49:12 +0000 | [diff] [blame] | 17 | return codecs.charmap_decode(input,errors,decoding_table) |
Tim Peters | 536cf99 | 2005-12-25 23:18:31 +0000 | [diff] [blame^] | 18 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 19 | class StreamWriter(Codec,codecs.StreamWriter): |
| 20 | pass |
Tim Peters | 469cdad | 2002-08-08 20:19:19 +0000 | [diff] [blame] | 21 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 22 | class StreamReader(Codec,codecs.StreamReader): |
| 23 | pass |
| 24 | |
| 25 | ### encodings module API |
| 26 | |
| 27 | def getregentry(): |
| 28 | |
| 29 | return (Codec().encode,Codec().decode,StreamReader,StreamWriter) |
| 30 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 31 | |
Marc-André Lemburg | a1129f4 | 2005-10-21 13:49:12 +0000 | [diff] [blame] | 32 | ### Decoding Table |
| 33 | |
| 34 | decoding_table = ( |
Tim Peters | 536cf99 | 2005-12-25 23:18:31 +0000 | [diff] [blame^] | 35 | u'\x00' # 0x00 -> NULL |
| 36 | u'\x01' # 0x01 -> START OF HEADING |
| 37 | u'\x02' # 0x02 -> START OF TEXT |
| 38 | u'\x03' # 0x03 -> END OF TEXT |
| 39 | u'\x04' # 0x04 -> END OF TRANSMISSION |
| 40 | u'\x05' # 0x05 -> ENQUIRY |
| 41 | u'\x06' # 0x06 -> ACKNOWLEDGE |
| 42 | u'\x07' # 0x07 -> BELL |
| 43 | u'\x08' # 0x08 -> BACKSPACE |
| 44 | u'\t' # 0x09 -> HORIZONTAL TABULATION |
| 45 | u'\n' # 0x0A -> LINE FEED |
| 46 | u'\x0b' # 0x0B -> VERTICAL TABULATION |
| 47 | u'\x0c' # 0x0C -> FORM FEED |
| 48 | u'\r' # 0x0D -> CARRIAGE RETURN |
| 49 | u'\x0e' # 0x0E -> SHIFT OUT |
| 50 | u'\x0f' # 0x0F -> SHIFT IN |
| 51 | u'\x10' # 0x10 -> DATA LINK ESCAPE |
| 52 | u'\x11' # 0x11 -> DEVICE CONTROL ONE |
| 53 | u'\x12' # 0x12 -> DEVICE CONTROL TWO |
| 54 | u'\x13' # 0x13 -> DEVICE CONTROL THREE |
| 55 | u'\x14' # 0x14 -> DEVICE CONTROL FOUR |
| 56 | u'\x15' # 0x15 -> NEGATIVE ACKNOWLEDGE |
| 57 | u'\x16' # 0x16 -> SYNCHRONOUS IDLE |
| 58 | u'\x17' # 0x17 -> END OF TRANSMISSION BLOCK |
| 59 | u'\x18' # 0x18 -> CANCEL |
| 60 | u'\x19' # 0x19 -> END OF MEDIUM |
| 61 | u'\x1a' # 0x1A -> SUBSTITUTE |
| 62 | u'\x1b' # 0x1B -> ESCAPE |
| 63 | u'\x1c' # 0x1C -> FILE SEPARATOR |
| 64 | u'\x1d' # 0x1D -> GROUP SEPARATOR |
| 65 | u'\x1e' # 0x1E -> RECORD SEPARATOR |
| 66 | u'\x1f' # 0x1F -> UNIT SEPARATOR |
| 67 | u' ' # 0x20 -> SPACE |
| 68 | u'!' # 0x21 -> EXCLAMATION MARK |
| 69 | u'"' # 0x22 -> QUOTATION MARK |
| 70 | u'#' # 0x23 -> NUMBER SIGN |
| 71 | u'$' # 0x24 -> DOLLAR SIGN |
| 72 | u'%' # 0x25 -> PERCENT SIGN |
| 73 | u'&' # 0x26 -> AMPERSAND |
| 74 | u"'" # 0x27 -> APOSTROPHE |
| 75 | u'(' # 0x28 -> LEFT PARENTHESIS |
| 76 | u')' # 0x29 -> RIGHT PARENTHESIS |
| 77 | u'*' # 0x2A -> ASTERISK |
| 78 | u'+' # 0x2B -> PLUS SIGN |
| 79 | u',' # 0x2C -> COMMA |
| 80 | u'-' # 0x2D -> HYPHEN-MINUS |
| 81 | u'.' # 0x2E -> FULL STOP |
| 82 | u'/' # 0x2F -> SOLIDUS |
| 83 | u'0' # 0x30 -> DIGIT ZERO |
| 84 | u'1' # 0x31 -> DIGIT ONE |
| 85 | u'2' # 0x32 -> DIGIT TWO |
| 86 | u'3' # 0x33 -> DIGIT THREE |
| 87 | u'4' # 0x34 -> DIGIT FOUR |
| 88 | u'5' # 0x35 -> DIGIT FIVE |
| 89 | u'6' # 0x36 -> DIGIT SIX |
| 90 | u'7' # 0x37 -> DIGIT SEVEN |
| 91 | u'8' # 0x38 -> DIGIT EIGHT |
| 92 | u'9' # 0x39 -> DIGIT NINE |
| 93 | u':' # 0x3A -> COLON |
| 94 | u';' # 0x3B -> SEMICOLON |
| 95 | u'<' # 0x3C -> LESS-THAN SIGN |
| 96 | u'=' # 0x3D -> EQUALS SIGN |
| 97 | u'>' # 0x3E -> GREATER-THAN SIGN |
| 98 | u'?' # 0x3F -> QUESTION MARK |
| 99 | u'@' # 0x40 -> COMMERCIAL AT |
| 100 | u'A' # 0x41 -> LATIN CAPITAL LETTER A |
| 101 | u'B' # 0x42 -> LATIN CAPITAL LETTER B |
| 102 | u'C' # 0x43 -> LATIN CAPITAL LETTER C |
| 103 | u'D' # 0x44 -> LATIN CAPITAL LETTER D |
| 104 | u'E' # 0x45 -> LATIN CAPITAL LETTER E |
| 105 | u'F' # 0x46 -> LATIN CAPITAL LETTER F |
| 106 | u'G' # 0x47 -> LATIN CAPITAL LETTER G |
| 107 | u'H' # 0x48 -> LATIN CAPITAL LETTER H |
| 108 | u'I' # 0x49 -> LATIN CAPITAL LETTER I |
| 109 | u'J' # 0x4A -> LATIN CAPITAL LETTER J |
| 110 | u'K' # 0x4B -> LATIN CAPITAL LETTER K |
| 111 | u'L' # 0x4C -> LATIN CAPITAL LETTER L |
| 112 | u'M' # 0x4D -> LATIN CAPITAL LETTER M |
| 113 | u'N' # 0x4E -> LATIN CAPITAL LETTER N |
| 114 | u'O' # 0x4F -> LATIN CAPITAL LETTER O |
| 115 | u'P' # 0x50 -> LATIN CAPITAL LETTER P |
| 116 | u'Q' # 0x51 -> LATIN CAPITAL LETTER Q |
| 117 | u'R' # 0x52 -> LATIN CAPITAL LETTER R |
| 118 | u'S' # 0x53 -> LATIN CAPITAL LETTER S |
| 119 | u'T' # 0x54 -> LATIN CAPITAL LETTER T |
| 120 | u'U' # 0x55 -> LATIN CAPITAL LETTER U |
| 121 | u'V' # 0x56 -> LATIN CAPITAL LETTER V |
| 122 | u'W' # 0x57 -> LATIN CAPITAL LETTER W |
| 123 | u'X' # 0x58 -> LATIN CAPITAL LETTER X |
| 124 | u'Y' # 0x59 -> LATIN CAPITAL LETTER Y |
| 125 | u'Z' # 0x5A -> LATIN CAPITAL LETTER Z |
| 126 | u'[' # 0x5B -> LEFT SQUARE BRACKET |
| 127 | u'\\' # 0x5C -> REVERSE SOLIDUS |
| 128 | u']' # 0x5D -> RIGHT SQUARE BRACKET |
| 129 | u'^' # 0x5E -> CIRCUMFLEX ACCENT |
| 130 | u'_' # 0x5F -> LOW LINE |
| 131 | u'`' # 0x60 -> GRAVE ACCENT |
| 132 | u'a' # 0x61 -> LATIN SMALL LETTER A |
| 133 | u'b' # 0x62 -> LATIN SMALL LETTER B |
| 134 | u'c' # 0x63 -> LATIN SMALL LETTER C |
| 135 | u'd' # 0x64 -> LATIN SMALL LETTER D |
| 136 | u'e' # 0x65 -> LATIN SMALL LETTER E |
| 137 | u'f' # 0x66 -> LATIN SMALL LETTER F |
| 138 | u'g' # 0x67 -> LATIN SMALL LETTER G |
| 139 | u'h' # 0x68 -> LATIN SMALL LETTER H |
| 140 | u'i' # 0x69 -> LATIN SMALL LETTER I |
| 141 | u'j' # 0x6A -> LATIN SMALL LETTER J |
| 142 | u'k' # 0x6B -> LATIN SMALL LETTER K |
| 143 | u'l' # 0x6C -> LATIN SMALL LETTER L |
| 144 | u'm' # 0x6D -> LATIN SMALL LETTER M |
| 145 | u'n' # 0x6E -> LATIN SMALL LETTER N |
| 146 | u'o' # 0x6F -> LATIN SMALL LETTER O |
| 147 | u'p' # 0x70 -> LATIN SMALL LETTER P |
| 148 | u'q' # 0x71 -> LATIN SMALL LETTER Q |
| 149 | u'r' # 0x72 -> LATIN SMALL LETTER R |
| 150 | u's' # 0x73 -> LATIN SMALL LETTER S |
| 151 | u't' # 0x74 -> LATIN SMALL LETTER T |
| 152 | u'u' # 0x75 -> LATIN SMALL LETTER U |
| 153 | u'v' # 0x76 -> LATIN SMALL LETTER V |
| 154 | u'w' # 0x77 -> LATIN SMALL LETTER W |
| 155 | u'x' # 0x78 -> LATIN SMALL LETTER X |
| 156 | u'y' # 0x79 -> LATIN SMALL LETTER Y |
| 157 | u'z' # 0x7A -> LATIN SMALL LETTER Z |
| 158 | u'{' # 0x7B -> LEFT CURLY BRACKET |
| 159 | u'|' # 0x7C -> VERTICAL LINE |
| 160 | u'}' # 0x7D -> RIGHT CURLY BRACKET |
| 161 | u'~' # 0x7E -> TILDE |
| 162 | u'\x7f' # 0x7F -> DELETE |
| 163 | u'\u2500' # 0x80 -> BOX DRAWINGS LIGHT HORIZONTAL |
| 164 | u'\u2502' # 0x81 -> BOX DRAWINGS LIGHT VERTICAL |
| 165 | u'\u250c' # 0x82 -> BOX DRAWINGS LIGHT DOWN AND RIGHT |
| 166 | u'\u2510' # 0x83 -> BOX DRAWINGS LIGHT DOWN AND LEFT |
| 167 | u'\u2514' # 0x84 -> BOX DRAWINGS LIGHT UP AND RIGHT |
| 168 | u'\u2518' # 0x85 -> BOX DRAWINGS LIGHT UP AND LEFT |
| 169 | u'\u251c' # 0x86 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT |
| 170 | u'\u2524' # 0x87 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT |
| 171 | u'\u252c' # 0x88 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL |
| 172 | u'\u2534' # 0x89 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL |
| 173 | u'\u253c' # 0x8A -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL |
| 174 | u'\u2580' # 0x8B -> UPPER HALF BLOCK |
| 175 | u'\u2584' # 0x8C -> LOWER HALF BLOCK |
| 176 | u'\u2588' # 0x8D -> FULL BLOCK |
| 177 | u'\u258c' # 0x8E -> LEFT HALF BLOCK |
| 178 | u'\u2590' # 0x8F -> RIGHT HALF BLOCK |
| 179 | u'\u2591' # 0x90 -> LIGHT SHADE |
| 180 | u'\u2592' # 0x91 -> MEDIUM SHADE |
| 181 | u'\u2593' # 0x92 -> DARK SHADE |
| 182 | u'\u2320' # 0x93 -> TOP HALF INTEGRAL |
| 183 | u'\u25a0' # 0x94 -> BLACK SQUARE |
| 184 | u'\u2219' # 0x95 -> BULLET OPERATOR |
| 185 | u'\u221a' # 0x96 -> SQUARE ROOT |
| 186 | u'\u2248' # 0x97 -> ALMOST EQUAL TO |
| 187 | u'\u2264' # 0x98 -> LESS-THAN OR EQUAL TO |
| 188 | u'\u2265' # 0x99 -> GREATER-THAN OR EQUAL TO |
| 189 | u'\xa0' # 0x9A -> NO-BREAK SPACE |
| 190 | u'\u2321' # 0x9B -> BOTTOM HALF INTEGRAL |
| 191 | u'\xb0' # 0x9C -> DEGREE SIGN |
| 192 | u'\xb2' # 0x9D -> SUPERSCRIPT TWO |
| 193 | u'\xb7' # 0x9E -> MIDDLE DOT |
| 194 | u'\xf7' # 0x9F -> DIVISION SIGN |
| 195 | u'\u2550' # 0xA0 -> BOX DRAWINGS DOUBLE HORIZONTAL |
| 196 | u'\u2551' # 0xA1 -> BOX DRAWINGS DOUBLE VERTICAL |
| 197 | u'\u2552' # 0xA2 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE |
| 198 | u'\u0451' # 0xA3 -> CYRILLIC SMALL LETTER IO |
| 199 | u'\u2553' # 0xA4 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE |
| 200 | u'\u2554' # 0xA5 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT |
| 201 | u'\u2555' # 0xA6 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE |
| 202 | u'\u2556' # 0xA7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE |
| 203 | u'\u2557' # 0xA8 -> BOX DRAWINGS DOUBLE DOWN AND LEFT |
| 204 | u'\u2558' # 0xA9 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE |
| 205 | u'\u2559' # 0xAA -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE |
| 206 | u'\u255a' # 0xAB -> BOX DRAWINGS DOUBLE UP AND RIGHT |
| 207 | u'\u255b' # 0xAC -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE |
| 208 | u'\u255c' # 0xAD -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE |
| 209 | u'\u255d' # 0xAE -> BOX DRAWINGS DOUBLE UP AND LEFT |
| 210 | u'\u255e' # 0xAF -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE |
| 211 | u'\u255f' # 0xB0 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE |
| 212 | u'\u2560' # 0xB1 -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT |
| 213 | u'\u2561' # 0xB2 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE |
| 214 | u'\u0401' # 0xB3 -> CYRILLIC CAPITAL LETTER IO |
| 215 | u'\u2562' # 0xB4 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE |
| 216 | u'\u2563' # 0xB5 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT |
| 217 | u'\u2564' # 0xB6 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE |
| 218 | u'\u2565' # 0xB7 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE |
| 219 | u'\u2566' # 0xB8 -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL |
| 220 | u'\u2567' # 0xB9 -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE |
| 221 | u'\u2568' # 0xBA -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE |
| 222 | u'\u2569' # 0xBB -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL |
| 223 | u'\u256a' # 0xBC -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE |
| 224 | u'\u256b' # 0xBD -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE |
| 225 | u'\u256c' # 0xBE -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL |
| 226 | u'\xa9' # 0xBF -> COPYRIGHT SIGN |
| 227 | u'\u044e' # 0xC0 -> CYRILLIC SMALL LETTER YU |
| 228 | u'\u0430' # 0xC1 -> CYRILLIC SMALL LETTER A |
| 229 | u'\u0431' # 0xC2 -> CYRILLIC SMALL LETTER BE |
| 230 | u'\u0446' # 0xC3 -> CYRILLIC SMALL LETTER TSE |
| 231 | u'\u0434' # 0xC4 -> CYRILLIC SMALL LETTER DE |
| 232 | u'\u0435' # 0xC5 -> CYRILLIC SMALL LETTER IE |
| 233 | u'\u0444' # 0xC6 -> CYRILLIC SMALL LETTER EF |
| 234 | u'\u0433' # 0xC7 -> CYRILLIC SMALL LETTER GHE |
| 235 | u'\u0445' # 0xC8 -> CYRILLIC SMALL LETTER HA |
| 236 | u'\u0438' # 0xC9 -> CYRILLIC SMALL LETTER I |
| 237 | u'\u0439' # 0xCA -> CYRILLIC SMALL LETTER SHORT I |
| 238 | u'\u043a' # 0xCB -> CYRILLIC SMALL LETTER KA |
| 239 | u'\u043b' # 0xCC -> CYRILLIC SMALL LETTER EL |
| 240 | u'\u043c' # 0xCD -> CYRILLIC SMALL LETTER EM |
| 241 | u'\u043d' # 0xCE -> CYRILLIC SMALL LETTER EN |
| 242 | u'\u043e' # 0xCF -> CYRILLIC SMALL LETTER O |
| 243 | u'\u043f' # 0xD0 -> CYRILLIC SMALL LETTER PE |
| 244 | u'\u044f' # 0xD1 -> CYRILLIC SMALL LETTER YA |
| 245 | u'\u0440' # 0xD2 -> CYRILLIC SMALL LETTER ER |
| 246 | u'\u0441' # 0xD3 -> CYRILLIC SMALL LETTER ES |
| 247 | u'\u0442' # 0xD4 -> CYRILLIC SMALL LETTER TE |
| 248 | u'\u0443' # 0xD5 -> CYRILLIC SMALL LETTER U |
| 249 | u'\u0436' # 0xD6 -> CYRILLIC SMALL LETTER ZHE |
| 250 | u'\u0432' # 0xD7 -> CYRILLIC SMALL LETTER VE |
| 251 | u'\u044c' # 0xD8 -> CYRILLIC SMALL LETTER SOFT SIGN |
| 252 | u'\u044b' # 0xD9 -> CYRILLIC SMALL LETTER YERU |
| 253 | u'\u0437' # 0xDA -> CYRILLIC SMALL LETTER ZE |
| 254 | u'\u0448' # 0xDB -> CYRILLIC SMALL LETTER SHA |
| 255 | u'\u044d' # 0xDC -> CYRILLIC SMALL LETTER E |
| 256 | u'\u0449' # 0xDD -> CYRILLIC SMALL LETTER SHCHA |
| 257 | u'\u0447' # 0xDE -> CYRILLIC SMALL LETTER CHE |
| 258 | u'\u044a' # 0xDF -> CYRILLIC SMALL LETTER HARD SIGN |
| 259 | u'\u042e' # 0xE0 -> CYRILLIC CAPITAL LETTER YU |
| 260 | u'\u0410' # 0xE1 -> CYRILLIC CAPITAL LETTER A |
| 261 | u'\u0411' # 0xE2 -> CYRILLIC CAPITAL LETTER BE |
| 262 | u'\u0426' # 0xE3 -> CYRILLIC CAPITAL LETTER TSE |
| 263 | u'\u0414' # 0xE4 -> CYRILLIC CAPITAL LETTER DE |
| 264 | u'\u0415' # 0xE5 -> CYRILLIC CAPITAL LETTER IE |
| 265 | u'\u0424' # 0xE6 -> CYRILLIC CAPITAL LETTER EF |
| 266 | u'\u0413' # 0xE7 -> CYRILLIC CAPITAL LETTER GHE |
| 267 | u'\u0425' # 0xE8 -> CYRILLIC CAPITAL LETTER HA |
| 268 | u'\u0418' # 0xE9 -> CYRILLIC CAPITAL LETTER I |
| 269 | u'\u0419' # 0xEA -> CYRILLIC CAPITAL LETTER SHORT I |
| 270 | u'\u041a' # 0xEB -> CYRILLIC CAPITAL LETTER KA |
| 271 | u'\u041b' # 0xEC -> CYRILLIC CAPITAL LETTER EL |
| 272 | u'\u041c' # 0xED -> CYRILLIC CAPITAL LETTER EM |
| 273 | u'\u041d' # 0xEE -> CYRILLIC CAPITAL LETTER EN |
| 274 | u'\u041e' # 0xEF -> CYRILLIC CAPITAL LETTER O |
| 275 | u'\u041f' # 0xF0 -> CYRILLIC CAPITAL LETTER PE |
| 276 | u'\u042f' # 0xF1 -> CYRILLIC CAPITAL LETTER YA |
| 277 | u'\u0420' # 0xF2 -> CYRILLIC CAPITAL LETTER ER |
| 278 | u'\u0421' # 0xF3 -> CYRILLIC CAPITAL LETTER ES |
| 279 | u'\u0422' # 0xF4 -> CYRILLIC CAPITAL LETTER TE |
| 280 | u'\u0423' # 0xF5 -> CYRILLIC CAPITAL LETTER U |
| 281 | u'\u0416' # 0xF6 -> CYRILLIC CAPITAL LETTER ZHE |
| 282 | u'\u0412' # 0xF7 -> CYRILLIC CAPITAL LETTER VE |
| 283 | u'\u042c' # 0xF8 -> CYRILLIC CAPITAL LETTER SOFT SIGN |
| 284 | u'\u042b' # 0xF9 -> CYRILLIC CAPITAL LETTER YERU |
| 285 | u'\u0417' # 0xFA -> CYRILLIC CAPITAL LETTER ZE |
| 286 | u'\u0428' # 0xFB -> CYRILLIC CAPITAL LETTER SHA |
| 287 | u'\u042d' # 0xFC -> CYRILLIC CAPITAL LETTER E |
| 288 | u'\u0429' # 0xFD -> CYRILLIC CAPITAL LETTER SHCHA |
| 289 | u'\u0427' # 0xFE -> CYRILLIC CAPITAL LETTER CHE |
| 290 | u'\u042a' # 0xFF -> CYRILLIC CAPITAL LETTER HARD SIGN |
Marc-André Lemburg | a1129f4 | 2005-10-21 13:49:12 +0000 | [diff] [blame] | 291 | ) |
| 292 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 293 | ### Encoding Map |
| 294 | |
Marc-André Lemburg | a1129f4 | 2005-10-21 13:49:12 +0000 | [diff] [blame] | 295 | encoding_map = { |
Tim Peters | 536cf99 | 2005-12-25 23:18:31 +0000 | [diff] [blame^] | 296 | 0x0000: 0x00, # NULL |
| 297 | 0x0001: 0x01, # START OF HEADING |
| 298 | 0x0002: 0x02, # START OF TEXT |
| 299 | 0x0003: 0x03, # END OF TEXT |
| 300 | 0x0004: 0x04, # END OF TRANSMISSION |
| 301 | 0x0005: 0x05, # ENQUIRY |
| 302 | 0x0006: 0x06, # ACKNOWLEDGE |
| 303 | 0x0007: 0x07, # BELL |
| 304 | 0x0008: 0x08, # BACKSPACE |
| 305 | 0x0009: 0x09, # HORIZONTAL TABULATION |
| 306 | 0x000A: 0x0A, # LINE FEED |
| 307 | 0x000B: 0x0B, # VERTICAL TABULATION |
| 308 | 0x000C: 0x0C, # FORM FEED |
| 309 | 0x000D: 0x0D, # CARRIAGE RETURN |
| 310 | 0x000E: 0x0E, # SHIFT OUT |
| 311 | 0x000F: 0x0F, # SHIFT IN |
| 312 | 0x0010: 0x10, # DATA LINK ESCAPE |
| 313 | 0x0011: 0x11, # DEVICE CONTROL ONE |
| 314 | 0x0012: 0x12, # DEVICE CONTROL TWO |
| 315 | 0x0013: 0x13, # DEVICE CONTROL THREE |
| 316 | 0x0014: 0x14, # DEVICE CONTROL FOUR |
| 317 | 0x0015: 0x15, # NEGATIVE ACKNOWLEDGE |
| 318 | 0x0016: 0x16, # SYNCHRONOUS IDLE |
| 319 | 0x0017: 0x17, # END OF TRANSMISSION BLOCK |
| 320 | 0x0018: 0x18, # CANCEL |
| 321 | 0x0019: 0x19, # END OF MEDIUM |
| 322 | 0x001A: 0x1A, # SUBSTITUTE |
| 323 | 0x001B: 0x1B, # ESCAPE |
| 324 | 0x001C: 0x1C, # FILE SEPARATOR |
| 325 | 0x001D: 0x1D, # GROUP SEPARATOR |
| 326 | 0x001E: 0x1E, # RECORD SEPARATOR |
| 327 | 0x001F: 0x1F, # UNIT SEPARATOR |
| 328 | 0x0020: 0x20, # SPACE |
| 329 | 0x0021: 0x21, # EXCLAMATION MARK |
| 330 | 0x0022: 0x22, # QUOTATION MARK |
| 331 | 0x0023: 0x23, # NUMBER SIGN |
| 332 | 0x0024: 0x24, # DOLLAR SIGN |
| 333 | 0x0025: 0x25, # PERCENT SIGN |
| 334 | 0x0026: 0x26, # AMPERSAND |
| 335 | 0x0027: 0x27, # APOSTROPHE |
| 336 | 0x0028: 0x28, # LEFT PARENTHESIS |
| 337 | 0x0029: 0x29, # RIGHT PARENTHESIS |
| 338 | 0x002A: 0x2A, # ASTERISK |
| 339 | 0x002B: 0x2B, # PLUS SIGN |
| 340 | 0x002C: 0x2C, # COMMA |
| 341 | 0x002D: 0x2D, # HYPHEN-MINUS |
| 342 | 0x002E: 0x2E, # FULL STOP |
| 343 | 0x002F: 0x2F, # SOLIDUS |
| 344 | 0x0030: 0x30, # DIGIT ZERO |
| 345 | 0x0031: 0x31, # DIGIT ONE |
| 346 | 0x0032: 0x32, # DIGIT TWO |
| 347 | 0x0033: 0x33, # DIGIT THREE |
| 348 | 0x0034: 0x34, # DIGIT FOUR |
| 349 | 0x0035: 0x35, # DIGIT FIVE |
| 350 | 0x0036: 0x36, # DIGIT SIX |
| 351 | 0x0037: 0x37, # DIGIT SEVEN |
| 352 | 0x0038: 0x38, # DIGIT EIGHT |
| 353 | 0x0039: 0x39, # DIGIT NINE |
| 354 | 0x003A: 0x3A, # COLON |
| 355 | 0x003B: 0x3B, # SEMICOLON |
| 356 | 0x003C: 0x3C, # LESS-THAN SIGN |
| 357 | 0x003D: 0x3D, # EQUALS SIGN |
| 358 | 0x003E: 0x3E, # GREATER-THAN SIGN |
| 359 | 0x003F: 0x3F, # QUESTION MARK |
| 360 | 0x0040: 0x40, # COMMERCIAL AT |
| 361 | 0x0041: 0x41, # LATIN CAPITAL LETTER A |
| 362 | 0x0042: 0x42, # LATIN CAPITAL LETTER B |
| 363 | 0x0043: 0x43, # LATIN CAPITAL LETTER C |
| 364 | 0x0044: 0x44, # LATIN CAPITAL LETTER D |
| 365 | 0x0045: 0x45, # LATIN CAPITAL LETTER E |
| 366 | 0x0046: 0x46, # LATIN CAPITAL LETTER F |
| 367 | 0x0047: 0x47, # LATIN CAPITAL LETTER G |
| 368 | 0x0048: 0x48, # LATIN CAPITAL LETTER H |
| 369 | 0x0049: 0x49, # LATIN CAPITAL LETTER I |
| 370 | 0x004A: 0x4A, # LATIN CAPITAL LETTER J |
| 371 | 0x004B: 0x4B, # LATIN CAPITAL LETTER K |
| 372 | 0x004C: 0x4C, # LATIN CAPITAL LETTER L |
| 373 | 0x004D: 0x4D, # LATIN CAPITAL LETTER M |
| 374 | 0x004E: 0x4E, # LATIN CAPITAL LETTER N |
| 375 | 0x004F: 0x4F, # LATIN CAPITAL LETTER O |
| 376 | 0x0050: 0x50, # LATIN CAPITAL LETTER P |
| 377 | 0x0051: 0x51, # LATIN CAPITAL LETTER Q |
| 378 | 0x0052: 0x52, # LATIN CAPITAL LETTER R |
| 379 | 0x0053: 0x53, # LATIN CAPITAL LETTER S |
| 380 | 0x0054: 0x54, # LATIN CAPITAL LETTER T |
| 381 | 0x0055: 0x55, # LATIN CAPITAL LETTER U |
| 382 | 0x0056: 0x56, # LATIN CAPITAL LETTER V |
| 383 | 0x0057: 0x57, # LATIN CAPITAL LETTER W |
| 384 | 0x0058: 0x58, # LATIN CAPITAL LETTER X |
| 385 | 0x0059: 0x59, # LATIN CAPITAL LETTER Y |
| 386 | 0x005A: 0x5A, # LATIN CAPITAL LETTER Z |
| 387 | 0x005B: 0x5B, # LEFT SQUARE BRACKET |
| 388 | 0x005C: 0x5C, # REVERSE SOLIDUS |
| 389 | 0x005D: 0x5D, # RIGHT SQUARE BRACKET |
| 390 | 0x005E: 0x5E, # CIRCUMFLEX ACCENT |
| 391 | 0x005F: 0x5F, # LOW LINE |
| 392 | 0x0060: 0x60, # GRAVE ACCENT |
| 393 | 0x0061: 0x61, # LATIN SMALL LETTER A |
| 394 | 0x0062: 0x62, # LATIN SMALL LETTER B |
| 395 | 0x0063: 0x63, # LATIN SMALL LETTER C |
| 396 | 0x0064: 0x64, # LATIN SMALL LETTER D |
| 397 | 0x0065: 0x65, # LATIN SMALL LETTER E |
| 398 | 0x0066: 0x66, # LATIN SMALL LETTER F |
| 399 | 0x0067: 0x67, # LATIN SMALL LETTER G |
| 400 | 0x0068: 0x68, # LATIN SMALL LETTER H |
| 401 | 0x0069: 0x69, # LATIN SMALL LETTER I |
| 402 | 0x006A: 0x6A, # LATIN SMALL LETTER J |
| 403 | 0x006B: 0x6B, # LATIN SMALL LETTER K |
| 404 | 0x006C: 0x6C, # LATIN SMALL LETTER L |
| 405 | 0x006D: 0x6D, # LATIN SMALL LETTER M |
| 406 | 0x006E: 0x6E, # LATIN SMALL LETTER N |
| 407 | 0x006F: 0x6F, # LATIN SMALL LETTER O |
| 408 | 0x0070: 0x70, # LATIN SMALL LETTER P |
| 409 | 0x0071: 0x71, # LATIN SMALL LETTER Q |
| 410 | 0x0072: 0x72, # LATIN SMALL LETTER R |
| 411 | 0x0073: 0x73, # LATIN SMALL LETTER S |
| 412 | 0x0074: 0x74, # LATIN SMALL LETTER T |
| 413 | 0x0075: 0x75, # LATIN SMALL LETTER U |
| 414 | 0x0076: 0x76, # LATIN SMALL LETTER V |
| 415 | 0x0077: 0x77, # LATIN SMALL LETTER W |
| 416 | 0x0078: 0x78, # LATIN SMALL LETTER X |
| 417 | 0x0079: 0x79, # LATIN SMALL LETTER Y |
| 418 | 0x007A: 0x7A, # LATIN SMALL LETTER Z |
| 419 | 0x007B: 0x7B, # LEFT CURLY BRACKET |
| 420 | 0x007C: 0x7C, # VERTICAL LINE |
| 421 | 0x007D: 0x7D, # RIGHT CURLY BRACKET |
| 422 | 0x007E: 0x7E, # TILDE |
| 423 | 0x007F: 0x7F, # DELETE |
| 424 | 0x00A0: 0x9A, # NO-BREAK SPACE |
| 425 | 0x00A9: 0xBF, # COPYRIGHT SIGN |
| 426 | 0x00B0: 0x9C, # DEGREE SIGN |
| 427 | 0x00B2: 0x9D, # SUPERSCRIPT TWO |
| 428 | 0x00B7: 0x9E, # MIDDLE DOT |
| 429 | 0x00F7: 0x9F, # DIVISION SIGN |
| 430 | 0x0401: 0xB3, # CYRILLIC CAPITAL LETTER IO |
| 431 | 0x0410: 0xE1, # CYRILLIC CAPITAL LETTER A |
| 432 | 0x0411: 0xE2, # CYRILLIC CAPITAL LETTER BE |
| 433 | 0x0412: 0xF7, # CYRILLIC CAPITAL LETTER VE |
| 434 | 0x0413: 0xE7, # CYRILLIC CAPITAL LETTER GHE |
| 435 | 0x0414: 0xE4, # CYRILLIC CAPITAL LETTER DE |
| 436 | 0x0415: 0xE5, # CYRILLIC CAPITAL LETTER IE |
| 437 | 0x0416: 0xF6, # CYRILLIC CAPITAL LETTER ZHE |
| 438 | 0x0417: 0xFA, # CYRILLIC CAPITAL LETTER ZE |
| 439 | 0x0418: 0xE9, # CYRILLIC CAPITAL LETTER I |
| 440 | 0x0419: 0xEA, # CYRILLIC CAPITAL LETTER SHORT I |
| 441 | 0x041A: 0xEB, # CYRILLIC CAPITAL LETTER KA |
| 442 | 0x041B: 0xEC, # CYRILLIC CAPITAL LETTER EL |
| 443 | 0x041C: 0xED, # CYRILLIC CAPITAL LETTER EM |
| 444 | 0x041D: 0xEE, # CYRILLIC CAPITAL LETTER EN |
| 445 | 0x041E: 0xEF, # CYRILLIC CAPITAL LETTER O |
| 446 | 0x041F: 0xF0, # CYRILLIC CAPITAL LETTER PE |
| 447 | 0x0420: 0xF2, # CYRILLIC CAPITAL LETTER ER |
| 448 | 0x0421: 0xF3, # CYRILLIC CAPITAL LETTER ES |
| 449 | 0x0422: 0xF4, # CYRILLIC CAPITAL LETTER TE |
| 450 | 0x0423: 0xF5, # CYRILLIC CAPITAL LETTER U |
| 451 | 0x0424: 0xE6, # CYRILLIC CAPITAL LETTER EF |
| 452 | 0x0425: 0xE8, # CYRILLIC CAPITAL LETTER HA |
| 453 | 0x0426: 0xE3, # CYRILLIC CAPITAL LETTER TSE |
| 454 | 0x0427: 0xFE, # CYRILLIC CAPITAL LETTER CHE |
| 455 | 0x0428: 0xFB, # CYRILLIC CAPITAL LETTER SHA |
| 456 | 0x0429: 0xFD, # CYRILLIC CAPITAL LETTER SHCHA |
| 457 | 0x042A: 0xFF, # CYRILLIC CAPITAL LETTER HARD SIGN |
| 458 | 0x042B: 0xF9, # CYRILLIC CAPITAL LETTER YERU |
| 459 | 0x042C: 0xF8, # CYRILLIC CAPITAL LETTER SOFT SIGN |
| 460 | 0x042D: 0xFC, # CYRILLIC CAPITAL LETTER E |
| 461 | 0x042E: 0xE0, # CYRILLIC CAPITAL LETTER YU |
| 462 | 0x042F: 0xF1, # CYRILLIC CAPITAL LETTER YA |
| 463 | 0x0430: 0xC1, # CYRILLIC SMALL LETTER A |
| 464 | 0x0431: 0xC2, # CYRILLIC SMALL LETTER BE |
| 465 | 0x0432: 0xD7, # CYRILLIC SMALL LETTER VE |
| 466 | 0x0433: 0xC7, # CYRILLIC SMALL LETTER GHE |
| 467 | 0x0434: 0xC4, # CYRILLIC SMALL LETTER DE |
| 468 | 0x0435: 0xC5, # CYRILLIC SMALL LETTER IE |
| 469 | 0x0436: 0xD6, # CYRILLIC SMALL LETTER ZHE |
| 470 | 0x0437: 0xDA, # CYRILLIC SMALL LETTER ZE |
| 471 | 0x0438: 0xC9, # CYRILLIC SMALL LETTER I |
| 472 | 0x0439: 0xCA, # CYRILLIC SMALL LETTER SHORT I |
| 473 | 0x043A: 0xCB, # CYRILLIC SMALL LETTER KA |
| 474 | 0x043B: 0xCC, # CYRILLIC SMALL LETTER EL |
| 475 | 0x043C: 0xCD, # CYRILLIC SMALL LETTER EM |
| 476 | 0x043D: 0xCE, # CYRILLIC SMALL LETTER EN |
| 477 | 0x043E: 0xCF, # CYRILLIC SMALL LETTER O |
| 478 | 0x043F: 0xD0, # CYRILLIC SMALL LETTER PE |
| 479 | 0x0440: 0xD2, # CYRILLIC SMALL LETTER ER |
| 480 | 0x0441: 0xD3, # CYRILLIC SMALL LETTER ES |
| 481 | 0x0442: 0xD4, # CYRILLIC SMALL LETTER TE |
| 482 | 0x0443: 0xD5, # CYRILLIC SMALL LETTER U |
| 483 | 0x0444: 0xC6, # CYRILLIC SMALL LETTER EF |
| 484 | 0x0445: 0xC8, # CYRILLIC SMALL LETTER HA |
| 485 | 0x0446: 0xC3, # CYRILLIC SMALL LETTER TSE |
| 486 | 0x0447: 0xDE, # CYRILLIC SMALL LETTER CHE |
| 487 | 0x0448: 0xDB, # CYRILLIC SMALL LETTER SHA |
| 488 | 0x0449: 0xDD, # CYRILLIC SMALL LETTER SHCHA |
| 489 | 0x044A: 0xDF, # CYRILLIC SMALL LETTER HARD SIGN |
| 490 | 0x044B: 0xD9, # CYRILLIC SMALL LETTER YERU |
| 491 | 0x044C: 0xD8, # CYRILLIC SMALL LETTER SOFT SIGN |
| 492 | 0x044D: 0xDC, # CYRILLIC SMALL LETTER E |
| 493 | 0x044E: 0xC0, # CYRILLIC SMALL LETTER YU |
| 494 | 0x044F: 0xD1, # CYRILLIC SMALL LETTER YA |
| 495 | 0x0451: 0xA3, # CYRILLIC SMALL LETTER IO |
| 496 | 0x2219: 0x95, # BULLET OPERATOR |
| 497 | 0x221A: 0x96, # SQUARE ROOT |
| 498 | 0x2248: 0x97, # ALMOST EQUAL TO |
| 499 | 0x2264: 0x98, # LESS-THAN OR EQUAL TO |
| 500 | 0x2265: 0x99, # GREATER-THAN OR EQUAL TO |
| 501 | 0x2320: 0x93, # TOP HALF INTEGRAL |
| 502 | 0x2321: 0x9B, # BOTTOM HALF INTEGRAL |
| 503 | 0x2500: 0x80, # BOX DRAWINGS LIGHT HORIZONTAL |
| 504 | 0x2502: 0x81, # BOX DRAWINGS LIGHT VERTICAL |
| 505 | 0x250C: 0x82, # BOX DRAWINGS LIGHT DOWN AND RIGHT |
| 506 | 0x2510: 0x83, # BOX DRAWINGS LIGHT DOWN AND LEFT |
| 507 | 0x2514: 0x84, # BOX DRAWINGS LIGHT UP AND RIGHT |
| 508 | 0x2518: 0x85, # BOX DRAWINGS LIGHT UP AND LEFT |
| 509 | 0x251C: 0x86, # BOX DRAWINGS LIGHT VERTICAL AND RIGHT |
| 510 | 0x2524: 0x87, # BOX DRAWINGS LIGHT VERTICAL AND LEFT |
| 511 | 0x252C: 0x88, # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL |
| 512 | 0x2534: 0x89, # BOX DRAWINGS LIGHT UP AND HORIZONTAL |
| 513 | 0x253C: 0x8A, # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL |
| 514 | 0x2550: 0xA0, # BOX DRAWINGS DOUBLE HORIZONTAL |
| 515 | 0x2551: 0xA1, # BOX DRAWINGS DOUBLE VERTICAL |
| 516 | 0x2552: 0xA2, # BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE |
| 517 | 0x2553: 0xA4, # BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE |
| 518 | 0x2554: 0xA5, # BOX DRAWINGS DOUBLE DOWN AND RIGHT |
| 519 | 0x2555: 0xA6, # BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE |
| 520 | 0x2556: 0xA7, # BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE |
| 521 | 0x2557: 0xA8, # BOX DRAWINGS DOUBLE DOWN AND LEFT |
| 522 | 0x2558: 0xA9, # BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE |
| 523 | 0x2559: 0xAA, # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE |
| 524 | 0x255A: 0xAB, # BOX DRAWINGS DOUBLE UP AND RIGHT |
| 525 | 0x255B: 0xAC, # BOX DRAWINGS UP SINGLE AND LEFT DOUBLE |
| 526 | 0x255C: 0xAD, # BOX DRAWINGS UP DOUBLE AND LEFT SINGLE |
| 527 | 0x255D: 0xAE, # BOX DRAWINGS DOUBLE UP AND LEFT |
| 528 | 0x255E: 0xAF, # BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE |
| 529 | 0x255F: 0xB0, # BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE |
| 530 | 0x2560: 0xB1, # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT |
| 531 | 0x2561: 0xB2, # BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE |
| 532 | 0x2562: 0xB4, # BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE |
| 533 | 0x2563: 0xB5, # BOX DRAWINGS DOUBLE VERTICAL AND LEFT |
| 534 | 0x2564: 0xB6, # BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE |
| 535 | 0x2565: 0xB7, # BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE |
| 536 | 0x2566: 0xB8, # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL |
| 537 | 0x2567: 0xB9, # BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE |
| 538 | 0x2568: 0xBA, # BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE |
| 539 | 0x2569: 0xBB, # BOX DRAWINGS DOUBLE UP AND HORIZONTAL |
| 540 | 0x256A: 0xBC, # BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE |
| 541 | 0x256B: 0xBD, # BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE |
| 542 | 0x256C: 0xBE, # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL |
| 543 | 0x2580: 0x8B, # UPPER HALF BLOCK |
| 544 | 0x2584: 0x8C, # LOWER HALF BLOCK |
| 545 | 0x2588: 0x8D, # FULL BLOCK |
| 546 | 0x258C: 0x8E, # LEFT HALF BLOCK |
| 547 | 0x2590: 0x8F, # RIGHT HALF BLOCK |
| 548 | 0x2591: 0x90, # LIGHT SHADE |
| 549 | 0x2592: 0x91, # MEDIUM SHADE |
| 550 | 0x2593: 0x92, # DARK SHADE |
| 551 | 0x25A0: 0x94, # BLACK SQUARE |
Marc-André Lemburg | d9cf593 | 2005-10-24 12:14:59 +0000 | [diff] [blame] | 552 | } |