cp869.py (6148B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\carbon\common\stdlib\encodings\cp869.py 2 import codecs 3 4 class Codec(codecs.Codec): 5 6 def encode(self, input, errors = 'strict'): 7 return codecs.charmap_encode(input, errors, encoding_map) 8 9 def decode(self, input, errors = 'strict'): 10 return codecs.charmap_decode(input, errors, decoding_table) 11 12 13 class IncrementalEncoder(codecs.IncrementalEncoder): 14 15 def encode(self, input, final = False): 16 return codecs.charmap_encode(input, self.errors, encoding_map)[0] 17 18 19 class IncrementalDecoder(codecs.IncrementalDecoder): 20 21 def decode(self, input, final = False): 22 return codecs.charmap_decode(input, self.errors, decoding_table)[0] 23 24 25 class StreamWriter(Codec, codecs.StreamWriter): 26 pass 27 28 29 class StreamReader(Codec, codecs.StreamReader): 30 pass 31 32 33 def getregentry(): 34 return codecs.CodecInfo(name='cp869', encode=Codec().encode, decode=Codec().decode, incrementalencoder=IncrementalEncoder, incrementaldecoder=IncrementalDecoder, streamreader=StreamReader, streamwriter=StreamWriter) 35 36 37 decoding_map = codecs.make_identity_dict(range(256)) 38 decoding_map.update({128: None, 39 129: None, 40 130: None, 41 131: None, 42 132: None, 43 133: None, 44 134: 902, 45 135: None, 46 136: 183, 47 137: 172, 48 138: 166, 49 139: 8216, 50 140: 8217, 51 141: 904, 52 142: 8213, 53 143: 905, 54 144: 906, 55 145: 938, 56 146: 908, 57 147: None, 58 148: None, 59 149: 910, 60 150: 939, 61 151: 169, 62 152: 911, 63 153: 178, 64 154: 179, 65 155: 940, 66 156: 163, 67 157: 941, 68 158: 942, 69 159: 943, 70 160: 970, 71 161: 912, 72 162: 972, 73 163: 973, 74 164: 913, 75 165: 914, 76 166: 915, 77 167: 916, 78 168: 917, 79 169: 918, 80 170: 919, 81 171: 189, 82 172: 920, 83 173: 921, 84 174: 171, 85 175: 187, 86 176: 9617, 87 177: 9618, 88 178: 9619, 89 179: 9474, 90 180: 9508, 91 181: 922, 92 182: 923, 93 183: 924, 94 184: 925, 95 185: 9571, 96 186: 9553, 97 187: 9559, 98 188: 9565, 99 189: 926, 100 190: 927, 101 191: 9488, 102 192: 9492, 103 193: 9524, 104 194: 9516, 105 195: 9500, 106 196: 9472, 107 197: 9532, 108 198: 928, 109 199: 929, 110 200: 9562, 111 201: 9556, 112 202: 9577, 113 203: 9574, 114 204: 9568, 115 205: 9552, 116 206: 9580, 117 207: 931, 118 208: 932, 119 209: 933, 120 210: 934, 121 211: 935, 122 212: 936, 123 213: 937, 124 214: 945, 125 215: 946, 126 216: 947, 127 217: 9496, 128 218: 9484, 129 219: 9608, 130 220: 9604, 131 221: 948, 132 222: 949, 133 223: 9600, 134 224: 950, 135 225: 951, 136 226: 952, 137 227: 953, 138 228: 954, 139 229: 955, 140 230: 956, 141 231: 957, 142 232: 958, 143 233: 959, 144 234: 960, 145 235: 961, 146 236: 963, 147 237: 962, 148 238: 964, 149 239: 900, 150 240: 173, 151 241: 177, 152 242: 965, 153 243: 966, 154 244: 967, 155 245: 167, 156 246: 968, 157 247: 901, 158 248: 176, 159 249: 168, 160 250: 969, 161 251: 971, 162 252: 944, 163 253: 974, 164 254: 9632, 165 255: 160}) 166 decoding_table = u'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\ufffe\ufffe\ufffe\ufffe\ufffe\ufffe\u0386\ufffe\xb7\xac\xa6\u2018\u2019\u0388\u2015\u0389\u038a\u03aa\u038c\ufffe\ufffe\u038e\u03ab\xa9\u038f\xb2\xb3\u03ac\xa3\u03ad\u03ae\u03af\u03ca\u0390\u03cc\u03cd\u0391\u0392\u0393\u0394\u0395\u0396\u0397\xbd\u0398\u0399\xab\xbb\u2591\u2592\u2593\u2502\u2524\u039a\u039b\u039c\u039d\u2563\u2551\u2557\u255d\u039e\u039f\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u03a0\u03a1\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u03a3\u03a4\u03a5\u03a6\u03a7\u03a8\u03a9\u03b1\u03b2\u03b3\u2518\u250c\u2588\u2584\u03b4\u03b5\u2580\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c3\u03c2\u03c4\u0384\xad\xb1\u03c5\u03c6\u03c7\xa7\u03c8\u0385\xb0\xa8\u03c9\u03cb\u03b0\u03ce\u25a0\xa0' 167 encoding_map = {0: 0, 168 1: 1, 169 2: 2, 170 3: 3, 171 4: 4, 172 5: 5, 173 6: 6, 174 7: 7, 175 8: 8, 176 9: 9, 177 10: 10, 178 11: 11, 179 12: 12, 180 13: 13, 181 14: 14, 182 15: 15, 183 16: 16, 184 17: 17, 185 18: 18, 186 19: 19, 187 20: 20, 188 21: 21, 189 22: 22, 190 23: 23, 191 24: 24, 192 25: 25, 193 26: 26, 194 27: 27, 195 28: 28, 196 29: 29, 197 30: 30, 198 31: 31, 199 32: 32, 200 33: 33, 201 34: 34, 202 35: 35, 203 36: 36, 204 37: 37, 205 38: 38, 206 39: 39, 207 40: 40, 208 41: 41, 209 42: 42, 210 43: 43, 211 44: 44, 212 45: 45, 213 46: 46, 214 47: 47, 215 48: 48, 216 49: 49, 217 50: 50, 218 51: 51, 219 52: 52, 220 53: 53, 221 54: 54, 222 55: 55, 223 56: 56, 224 57: 57, 225 58: 58, 226 59: 59, 227 60: 60, 228 61: 61, 229 62: 62, 230 63: 63, 231 64: 64, 232 65: 65, 233 66: 66, 234 67: 67, 235 68: 68, 236 69: 69, 237 70: 70, 238 71: 71, 239 72: 72, 240 73: 73, 241 74: 74, 242 75: 75, 243 76: 76, 244 77: 77, 245 78: 78, 246 79: 79, 247 80: 80, 248 81: 81, 249 82: 82, 250 83: 83, 251 84: 84, 252 85: 85, 253 86: 86, 254 87: 87, 255 88: 88, 256 89: 89, 257 90: 90, 258 91: 91, 259 92: 92, 260 93: 93, 261 94: 94, 262 95: 95, 263 96: 96, 264 97: 97, 265 98: 98, 266 99: 99, 267 100: 100, 268 101: 101, 269 102: 102, 270 103: 103, 271 104: 104, 272 105: 105, 273 106: 106, 274 107: 107, 275 108: 108, 276 109: 109, 277 110: 110, 278 111: 111, 279 112: 112, 280 113: 113, 281 114: 114, 282 115: 115, 283 116: 116, 284 117: 117, 285 118: 118, 286 119: 119, 287 120: 120, 288 121: 121, 289 122: 122, 290 123: 123, 291 124: 124, 292 125: 125, 293 126: 126, 294 127: 127, 295 160: 255, 296 163: 156, 297 166: 138, 298 167: 245, 299 168: 249, 300 169: 151, 301 171: 174, 302 172: 137, 303 173: 240, 304 176: 248, 305 177: 241, 306 178: 153, 307 179: 154, 308 183: 136, 309 187: 175, 310 189: 171, 311 900: 239, 312 901: 247, 313 902: 134, 314 904: 141, 315 905: 143, 316 906: 144, 317 908: 146, 318 910: 149, 319 911: 152, 320 912: 161, 321 913: 164, 322 914: 165, 323 915: 166, 324 916: 167, 325 917: 168, 326 918: 169, 327 919: 170, 328 920: 172, 329 921: 173, 330 922: 181, 331 923: 182, 332 924: 183, 333 925: 184, 334 926: 189, 335 927: 190, 336 928: 198, 337 929: 199, 338 931: 207, 339 932: 208, 340 933: 209, 341 934: 210, 342 935: 211, 343 936: 212, 344 937: 213, 345 938: 145, 346 939: 150, 347 940: 155, 348 941: 157, 349 942: 158, 350 943: 159, 351 944: 252, 352 945: 214, 353 946: 215, 354 947: 216, 355 948: 221, 356 949: 222, 357 950: 224, 358 951: 225, 359 952: 226, 360 953: 227, 361 954: 228, 362 955: 229, 363 956: 230, 364 957: 231, 365 958: 232, 366 959: 233, 367 960: 234, 368 961: 235, 369 962: 237, 370 963: 236, 371 964: 238, 372 965: 242, 373 966: 243, 374 967: 244, 375 968: 246, 376 969: 250, 377 970: 160, 378 971: 251, 379 972: 162, 380 973: 163, 381 974: 253, 382 8213: 142, 383 8216: 139, 384 8217: 140, 385 9472: 196, 386 9474: 179, 387 9484: 218, 388 9488: 191, 389 9492: 192, 390 9496: 217, 391 9500: 195, 392 9508: 180, 393 9516: 194, 394 9524: 193, 395 9532: 197, 396 9552: 205, 397 9553: 186, 398 9556: 201, 399 9559: 187, 400 9562: 200, 401 9565: 188, 402 9568: 204, 403 9571: 185, 404 9574: 203, 405 9577: 202, 406 9580: 206, 407 9600: 223, 408 9604: 220, 409 9608: 219, 410 9617: 176, 411 9618: 177, 412 9619: 178, 413 9632: 254}