1 """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py. 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 return codecs.charmap_encode(input,errors,encoding_table) 13 14 def decode(self,input,errors='strict'): 15 return codecs.charmap_decode(input,errors,decoding_table) 16 17 class IncrementalEncoder(codecs.IncrementalEncoder): 18 def encode(self, input, final=False): 19 return codecs.charmap_encode(input,self.errors,encoding_table)[0] 20 21 class IncrementalDecoder(codecs.IncrementalDecoder): 22 def decode(self, input, final=False): 23 return codecs.charmap_decode(input,self.errors,decoding_table)[0] 24 25 class StreamWriter(Codec,codecs.StreamWriter): 26 pass 27 28 class StreamReader(Codec,codecs.StreamReader): 29 pass 30 31 ### encodings module API 32 33 def getregentry(): 34 return codecs.CodecInfo( 35 name='cp875', 36 encode=Codec().encode, 37 decode=Codec().decode, 38 incrementalencoder=IncrementalEncoder, 39 incrementaldecoder=IncrementalDecoder, 40 streamreader=StreamReader, 41 streamwriter=StreamWriter, 42 ) 43 44 45 ### Decoding Table 46 47 decoding_table = ( 48 u'\x00' # 0x00 -> NULL 49 u'\x01' # 0x01 -> START OF HEADING 50 u'\x02' # 0x02 -> START OF TEXT 51 u'\x03' # 0x03 -> END OF TEXT 52 u'\x9c' # 0x04 -> CONTROL 53 u'\t' # 0x05 -> HORIZONTAL TABULATION 54 u'\x86' # 0x06 -> CONTROL 55 u'\x7f' # 0x07 -> DELETE 56 u'\x97' # 0x08 -> CONTROL 57 u'\x8d' # 0x09 -> CONTROL 58 u'\x8e' # 0x0A -> CONTROL 59 u'\x0b' # 0x0B -> VERTICAL TABULATION 60 u'\x0c' # 0x0C -> FORM FEED 61 u'\r' # 0x0D -> CARRIAGE RETURN 62 u'\x0e' # 0x0E -> SHIFT OUT 63 u'\x0f' # 0x0F -> SHIFT IN 64 u'\x10' # 0x10 -> DATA LINK ESCAPE 65 u'\x11' # 0x11 -> DEVICE CONTROL ONE 66 u'\x12' # 0x12 -> DEVICE CONTROL TWO 67 u'\x13' # 0x13 -> DEVICE CONTROL THREE 68 u'\x9d' # 0x14 -> CONTROL 69 u'\x85' # 0x15 -> CONTROL 70 u'\x08' # 0x16 -> BACKSPACE 71 u'\x87' # 0x17 -> CONTROL 72 u'\x18' # 0x18 -> CANCEL 73 u'\x19' # 0x19 -> END OF MEDIUM 74 u'\x92' # 0x1A -> CONTROL 75 u'\x8f' # 0x1B -> CONTROL 76 u'\x1c' # 0x1C -> FILE SEPARATOR 77 u'\x1d' # 0x1D -> GROUP SEPARATOR 78 u'\x1e' # 0x1E -> RECORD SEPARATOR 79 u'\x1f' # 0x1F -> UNIT SEPARATOR 80 u'\x80' # 0x20 -> CONTROL 81 u'\x81' # 0x21 -> CONTROL 82 u'\x82' # 0x22 -> CONTROL 83 u'\x83' # 0x23 -> CONTROL 84 u'\x84' # 0x24 -> CONTROL 85 u'\n' # 0x25 -> LINE FEED 86 u'\x17' # 0x26 -> END OF TRANSMISSION BLOCK 87 u'\x1b' # 0x27 -> ESCAPE 88 u'\x88' # 0x28 -> CONTROL 89 u'\x89' # 0x29 -> CONTROL 90 u'\x8a' # 0x2A -> CONTROL 91 u'\x8b' # 0x2B -> CONTROL 92 u'\x8c' # 0x2C -> CONTROL 93 u'\x05' # 0x2D -> ENQUIRY 94 u'\x06' # 0x2E -> ACKNOWLEDGE 95 u'\x07' # 0x2F -> BELL 96 u'\x90' # 0x30 -> CONTROL 97 u'\x91' # 0x31 -> CONTROL 98 u'\x16' # 0x32 -> SYNCHRONOUS IDLE 99 u'\x93' # 0x33 -> CONTROL 100 u'\x94' # 0x34 -> CONTROL 101 u'\x95' # 0x35 -> CONTROL 102 u'\x96' # 0x36 -> CONTROL 103 u'\x04' # 0x37 -> END OF TRANSMISSION 104 u'\x98' # 0x38 -> CONTROL 105 u'\x99' # 0x39 -> CONTROL 106 u'\x9a' # 0x3A -> CONTROL 107 u'\x9b' # 0x3B -> CONTROL 108 u'\x14' # 0x3C -> DEVICE CONTROL FOUR 109 u'\x15' # 0x3D -> NEGATIVE ACKNOWLEDGE 110 u'\x9e' # 0x3E -> CONTROL 111 u'\x1a' # 0x3F -> SUBSTITUTE 112 u' ' # 0x40 -> SPACE 113 u'\u0391' # 0x41 -> GREEK CAPITAL LETTER ALPHA 114 u'\u0392' # 0x42 -> GREEK CAPITAL LETTER BETA 115 u'\u0393' # 0x43 -> GREEK CAPITAL LETTER GAMMA 116 u'\u0394' # 0x44 -> GREEK CAPITAL LETTER DELTA 117 u'\u0395' # 0x45 -> GREEK CAPITAL LETTER EPSILON 118 u'\u0396' # 0x46 -> GREEK CAPITAL LETTER ZETA 119 u'\u0397' # 0x47 -> GREEK CAPITAL LETTER ETA 120 u'\u0398' # 0x48 -> GREEK CAPITAL LETTER THETA 121 u'\u0399' # 0x49 -> GREEK CAPITAL LETTER IOTA 122 u'[' # 0x4A -> LEFT SQUARE BRACKET 123 u'.' # 0x4B -> FULL STOP 124 u'<' # 0x4C -> LESS-THAN SIGN 125 u'(' # 0x4D -> LEFT PARENTHESIS 126 u'+' # 0x4E -> PLUS SIGN 127 u'!' # 0x4F -> EXCLAMATION MARK 128 u'&' # 0x50 -> AMPERSAND 129 u'\u039a' # 0x51 -> GREEK CAPITAL LETTER KAPPA 130 u'\u039b' # 0x52 -> GREEK CAPITAL LETTER LAMDA 131 u'\u039c' # 0x53 -> GREEK CAPITAL LETTER MU 132 u'\u039d' # 0x54 -> GREEK CAPITAL LETTER NU 133 u'\u039e' # 0x55 -> GREEK CAPITAL LETTER XI 134 u'\u039f' # 0x56 -> GREEK CAPITAL LETTER OMICRON 135 u'\u03a0' # 0x57 -> GREEK CAPITAL LETTER PI 136 u'\u03a1' # 0x58 -> GREEK CAPITAL LETTER RHO 137 u'\u03a3' # 0x59 -> GREEK CAPITAL LETTER SIGMA 138 u']' # 0x5A -> RIGHT SQUARE BRACKET 139 u'$' # 0x5B -> DOLLAR SIGN 140 u'*' # 0x5C -> ASTERISK 141 u')' # 0x5D -> RIGHT PARENTHESIS 142 u';' # 0x5E -> SEMICOLON 143 u'^' # 0x5F -> CIRCUMFLEX ACCENT 144 u'-' # 0x60 -> HYPHEN-MINUS 145 u'/' # 0x61 -> SOLIDUS 146 u'\u03a4' # 0x62 -> GREEK CAPITAL LETTER TAU 147 u'\u03a5' # 0x63 -> GREEK CAPITAL LETTER UPSILON 148 u'\u03a6' # 0x64 -> GREEK CAPITAL LETTER PHI 149 u'\u03a7' # 0x65 -> GREEK CAPITAL LETTER CHI 150 u'\u03a8' # 0x66 -> GREEK CAPITAL LETTER PSI 151 u'\u03a9' # 0x67 -> GREEK CAPITAL LETTER OMEGA 152 u'\u03aa' # 0x68 -> GREEK CAPITAL LETTER IOTA WITH DIALYTIKA 153 u'\u03ab' # 0x69 -> GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA 154 u'|' # 0x6A -> VERTICAL LINE 155 u',' # 0x6B -> COMMA 156 u'%' # 0x6C -> PERCENT SIGN 157 u'_' # 0x6D -> LOW LINE 158 u'>' # 0x6E -> GREATER-THAN SIGN 159 u'?' # 0x6F -> QUESTION MARK 160 u'\xa8' # 0x70 -> DIAERESIS 161 u'\u0386' # 0x71 -> GREEK CAPITAL LETTER ALPHA WITH TONOS 162 u'\u0388' # 0x72 -> GREEK CAPITAL LETTER EPSILON WITH TONOS 163 u'\u0389' # 0x73 -> GREEK CAPITAL LETTER ETA WITH TONOS 164 u'\xa0' # 0x74 -> NO-BREAK SPACE 165 u'\u038a' # 0x75 -> GREEK CAPITAL LETTER IOTA WITH TONOS 166 u'\u038c' # 0x76 -> GREEK CAPITAL LETTER OMICRON WITH TONOS 167 u'\u038e' # 0x77 -> GREEK CAPITAL LETTER UPSILON WITH TONOS 168 u'\u038f' # 0x78 -> GREEK CAPITAL LETTER OMEGA WITH TONOS 169 u'`' # 0x79 -> GRAVE ACCENT 170 u':' # 0x7A -> COLON 171 u'#' # 0x7B -> NUMBER SIGN 172 u'@' # 0x7C -> COMMERCIAL AT 173 u"'" # 0x7D -> APOSTROPHE 174 u'=' # 0x7E -> EQUALS SIGN 175 u'"' # 0x7F -> QUOTATION MARK 176 u'\u0385' # 0x80 -> GREEK DIALYTIKA TONOS 177 u'a' # 0x81 -> LATIN SMALL LETTER A 178 u'b' # 0x82 -> LATIN SMALL LETTER B 179 u'c' # 0x83 -> LATIN SMALL LETTER C 180 u'd' # 0x84 -> LATIN SMALL LETTER D 181 u'e' # 0x85 -> LATIN SMALL LETTER E 182 u'f' # 0x86 -> LATIN SMALL LETTER F 183 u'g' # 0x87 -> LATIN SMALL LETTER G 184 u'h' # 0x88 -> LATIN SMALL LETTER H 185 u'i' # 0x89 -> LATIN SMALL LETTER I 186 u'\u03b1' # 0x8A -> GREEK SMALL LETTER ALPHA 187 u'\u03b2' # 0x8B -> GREEK SMALL LETTER BETA 188 u'\u03b3' # 0x8C -> GREEK SMALL LETTER GAMMA 189 u'\u03b4' # 0x8D -> GREEK SMALL LETTER DELTA 190 u'\u03b5' # 0x8E -> GREEK SMALL LETTER EPSILON 191 u'\u03b6' # 0x8F -> GREEK SMALL LETTER ZETA 192 u'\xb0' # 0x90 -> DEGREE SIGN 193 u'j' # 0x91 -> LATIN SMALL LETTER J 194 u'k' # 0x92 -> LATIN SMALL LETTER K 195 u'l' # 0x93 -> LATIN SMALL LETTER L 196 u'm' # 0x94 -> LATIN SMALL LETTER M 197 u'n' # 0x95 -> LATIN SMALL LETTER N 198 u'o' # 0x96 -> LATIN SMALL LETTER O 199 u'p' # 0x97 -> LATIN SMALL LETTER P 200 u'q' # 0x98 -> LATIN SMALL LETTER Q 201 u'r' # 0x99 -> LATIN SMALL LETTER R 202 u'\u03b7' # 0x9A -> GREEK SMALL LETTER ETA 203 u'\u03b8' # 0x9B -> GREEK SMALL LETTER THETA 204 u'\u03b9' # 0x9C -> GREEK SMALL LETTER IOTA 205 u'\u03ba' # 0x9D -> GREEK SMALL LETTER KAPPA 206 u'\u03bb' # 0x9E -> GREEK SMALL LETTER LAMDA 207 u'\u03bc' # 0x9F -> GREEK SMALL LETTER MU 208 u'\xb4' # 0xA0 -> ACUTE ACCENT 209 u'~' # 0xA1 -> TILDE 210 u's' # 0xA2 -> LATIN SMALL LETTER S 211 u't' # 0xA3 -> LATIN SMALL LETTER T 212 u'u' # 0xA4 -> LATIN SMALL LETTER U 213 u'v' # 0xA5 -> LATIN SMALL LETTER V 214 u'w' # 0xA6 -> LATIN SMALL LETTER W 215 u'x' # 0xA7 -> LATIN SMALL LETTER X 216 u'y' # 0xA8 -> LATIN SMALL LETTER Y 217 u'z' # 0xA9 -> LATIN SMALL LETTER Z 218 u'\u03bd' # 0xAA -> GREEK SMALL LETTER NU 219 u'\u03be' # 0xAB -> GREEK SMALL LETTER XI 220 u'\u03bf' # 0xAC -> GREEK SMALL LETTER OMICRON 221 u'\u03c0' # 0xAD -> GREEK SMALL LETTER PI 222 u'\u03c1' # 0xAE -> GREEK SMALL LETTER RHO 223 u'\u03c3' # 0xAF -> GREEK SMALL LETTER SIGMA 224 u'\xa3' # 0xB0 -> POUND SIGN 225 u'\u03ac' # 0xB1 -> GREEK SMALL LETTER ALPHA WITH TONOS 226 u'\u03ad' # 0xB2 -> GREEK SMALL LETTER EPSILON WITH TONOS 227 u'\u03ae' # 0xB3 -> GREEK SMALL LETTER ETA WITH TONOS 228 u'\u03ca' # 0xB4 -> GREEK SMALL LETTER IOTA WITH DIALYTIKA 229 u'\u03af' # 0xB5 -> GREEK SMALL LETTER IOTA WITH TONOS 230 u'\u03cc' # 0xB6 -> GREEK SMALL LETTER OMICRON WITH TONOS 231 u'\u03cd' # 0xB7 -> GREEK SMALL LETTER UPSILON WITH TONOS 232 u'\u03cb' # 0xB8 -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA 233 u'\u03ce' # 0xB9 -> GREEK SMALL LETTER OMEGA WITH TONOS 234 u'\u03c2' # 0xBA -> GREEK SMALL LETTER FINAL SIGMA 235 u'\u03c4' # 0xBB -> GREEK SMALL LETTER TAU 236 u'\u03c5' # 0xBC -> GREEK SMALL LETTER UPSILON 237 u'\u03c6' # 0xBD -> GREEK SMALL LETTER PHI 238 u'\u03c7' # 0xBE -> GREEK SMALL LETTER CHI 239 u'\u03c8' # 0xBF -> GREEK SMALL LETTER PSI 240 u'{' # 0xC0 -> LEFT CURLY BRACKET 241 u'A' # 0xC1 -> LATIN CAPITAL LETTER A 242 u'B' # 0xC2 -> LATIN CAPITAL LETTER B 243 u'C' # 0xC3 -> LATIN CAPITAL LETTER C 244 u'D' # 0xC4 -> LATIN CAPITAL LETTER D 245 u'E' # 0xC5 -> LATIN CAPITAL LETTER E 246 u'F' # 0xC6 -> LATIN CAPITAL LETTER F 247 u'G' # 0xC7 -> LATIN CAPITAL LETTER G 248 u'H' # 0xC8 -> LATIN CAPITAL LETTER H 249 u'I' # 0xC9 -> LATIN CAPITAL LETTER I 250 u'\xad' # 0xCA -> SOFT HYPHEN 251 u'\u03c9' # 0xCB -> GREEK SMALL LETTER OMEGA 252 u'\u0390' # 0xCC -> GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS 253 u'\u03b0' # 0xCD -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS 254 u'\u2018' # 0xCE -> LEFT SINGLE QUOTATION MARK 255 u'\u2015' # 0xCF -> HORIZONTAL BAR 256 u'}' # 0xD0 -> RIGHT CURLY BRACKET 257 u'J' # 0xD1 -> LATIN CAPITAL LETTER J 258 u'K' # 0xD2 -> LATIN CAPITAL LETTER K 259 u'L' # 0xD3 -> LATIN CAPITAL LETTER L 260 u'M' # 0xD4 -> LATIN CAPITAL LETTER M 261 u'N' # 0xD5 -> LATIN CAPITAL LETTER N 262 u'O' # 0xD6 -> LATIN CAPITAL LETTER O 263 u'P' # 0xD7 -> LATIN CAPITAL LETTER P 264 u'Q' # 0xD8 -> LATIN CAPITAL LETTER Q 265 u'R' # 0xD9 -> LATIN CAPITAL LETTER R 266 u'\xb1' # 0xDA -> PLUS-MINUS SIGN 267 u'\xbd' # 0xDB -> VULGAR FRACTION ONE HALF 268 u'\x1a' # 0xDC -> SUBSTITUTE 269 u'\u0387' # 0xDD -> GREEK ANO TELEIA 270 u'\u2019' # 0xDE -> RIGHT SINGLE QUOTATION MARK 271 u'\xa6' # 0xDF -> BROKEN BAR 272 u'\\' # 0xE0 -> REVERSE SOLIDUS 273 u'\x1a' # 0xE1 -> SUBSTITUTE 274 u'S' # 0xE2 -> LATIN CAPITAL LETTER S 275 u'T' # 0xE3 -> LATIN CAPITAL LETTER T 276 u'U' # 0xE4 -> LATIN CAPITAL LETTER U 277 u'V' # 0xE5 -> LATIN CAPITAL LETTER V 278 u'W' # 0xE6 -> LATIN CAPITAL LETTER W 279 u'X' # 0xE7 -> LATIN CAPITAL LETTER X 280 u'Y' # 0xE8 -> LATIN CAPITAL LETTER Y 281 u'Z' # 0xE9 -> LATIN CAPITAL LETTER Z 282 u'\xb2' # 0xEA -> SUPERSCRIPT TWO 283 u'\xa7' # 0xEB -> SECTION SIGN 284 u'\x1a' # 0xEC -> SUBSTITUTE 285 u'\x1a' # 0xED -> SUBSTITUTE 286 u'\xab' # 0xEE -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK 287 u'\xac' # 0xEF -> NOT SIGN 288 u'0' # 0xF0 -> DIGIT ZERO 289 u'1' # 0xF1 -> DIGIT ONE 290 u'2' # 0xF2 -> DIGIT TWO 291 u'3' # 0xF3 -> DIGIT THREE 292 u'4' # 0xF4 -> DIGIT FOUR 293 u'5' # 0xF5 -> DIGIT FIVE 294 u'6' # 0xF6 -> DIGIT SIX 295 u'7' # 0xF7 -> DIGIT SEVEN 296 u'8' # 0xF8 -> DIGIT EIGHT 297 u'9' # 0xF9 -> DIGIT NINE 298 u'\xb3' # 0xFA -> SUPERSCRIPT THREE 299 u'\xa9' # 0xFB -> COPYRIGHT SIGN 300 u'\x1a' # 0xFC -> SUBSTITUTE 301 u'\x1a' # 0xFD -> SUBSTITUTE 302 u'\xbb' # 0xFE -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK 303 u'\x9f' # 0xFF -> CONTROL 304 ) 305 306 ### Encoding table 307 encoding_table=codecs.charmap_build(decoding_table) 308