cp855.py (6438B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\carbon\common\stdlib\encodings\cp855.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='cp855', 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: 1106, 39 129: 1026, 40 130: 1107, 41 131: 1027, 42 132: 1105, 43 133: 1025, 44 134: 1108, 45 135: 1028, 46 136: 1109, 47 137: 1029, 48 138: 1110, 49 139: 1030, 50 140: 1111, 51 141: 1031, 52 142: 1112, 53 143: 1032, 54 144: 1113, 55 145: 1033, 56 146: 1114, 57 147: 1034, 58 148: 1115, 59 149: 1035, 60 150: 1116, 61 151: 1036, 62 152: 1118, 63 153: 1038, 64 154: 1119, 65 155: 1039, 66 156: 1102, 67 157: 1070, 68 158: 1098, 69 159: 1066, 70 160: 1072, 71 161: 1040, 72 162: 1073, 73 163: 1041, 74 164: 1094, 75 165: 1062, 76 166: 1076, 77 167: 1044, 78 168: 1077, 79 169: 1045, 80 170: 1092, 81 171: 1060, 82 172: 1075, 83 173: 1043, 84 174: 171, 85 175: 187, 86 176: 9617, 87 177: 9618, 88 178: 9619, 89 179: 9474, 90 180: 9508, 91 181: 1093, 92 182: 1061, 93 183: 1080, 94 184: 1048, 95 185: 9571, 96 186: 9553, 97 187: 9559, 98 188: 9565, 99 189: 1081, 100 190: 1049, 101 191: 9488, 102 192: 9492, 103 193: 9524, 104 194: 9516, 105 195: 9500, 106 196: 9472, 107 197: 9532, 108 198: 1082, 109 199: 1050, 110 200: 9562, 111 201: 9556, 112 202: 9577, 113 203: 9574, 114 204: 9568, 115 205: 9552, 116 206: 9580, 117 207: 164, 118 208: 1083, 119 209: 1051, 120 210: 1084, 121 211: 1052, 122 212: 1085, 123 213: 1053, 124 214: 1086, 125 215: 1054, 126 216: 1087, 127 217: 9496, 128 218: 9484, 129 219: 9608, 130 220: 9604, 131 221: 1055, 132 222: 1103, 133 223: 9600, 134 224: 1071, 135 225: 1088, 136 226: 1056, 137 227: 1089, 138 228: 1057, 139 229: 1090, 140 230: 1058, 141 231: 1091, 142 232: 1059, 143 233: 1078, 144 234: 1046, 145 235: 1074, 146 236: 1042, 147 237: 1100, 148 238: 1068, 149 239: 8470, 150 240: 173, 151 241: 1099, 152 242: 1067, 153 243: 1079, 154 244: 1047, 155 245: 1096, 156 246: 1064, 157 247: 1101, 158 248: 1069, 159 249: 1097, 160 250: 1065, 161 251: 1095, 162 252: 1063, 163 253: 167, 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\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045a\u040a\u045b\u040b\u045c\u040c\u045e\u040e\u045f\u040f\u044e\u042e\u044a\u042a\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\xab\xbb\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255d\u0439\u0419\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u043a\u041a\u255a\u2554\u2569\u2566\u2560\u2550\u256c\xa4\u043b\u041b\u043c\u041c\u043d\u041d\u043e\u041e\u043f\u2518\u250c\u2588\u2584\u041f\u044f\u2580\u042f\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044c\u042c\u2116\xad\u044b\u042b\u0437\u0417\u0448\u0428\u044d\u042d\u0449\u0429\u0447\u0427\xa7\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 164: 207, 297 167: 253, 298 171: 174, 299 173: 240, 300 187: 175, 301 1025: 133, 302 1026: 129, 303 1027: 131, 304 1028: 135, 305 1029: 137, 306 1030: 139, 307 1031: 141, 308 1032: 143, 309 1033: 145, 310 1034: 147, 311 1035: 149, 312 1036: 151, 313 1038: 153, 314 1039: 155, 315 1040: 161, 316 1041: 163, 317 1042: 236, 318 1043: 173, 319 1044: 167, 320 1045: 169, 321 1046: 234, 322 1047: 244, 323 1048: 184, 324 1049: 190, 325 1050: 199, 326 1051: 209, 327 1052: 211, 328 1053: 213, 329 1054: 215, 330 1055: 221, 331 1056: 226, 332 1057: 228, 333 1058: 230, 334 1059: 232, 335 1060: 171, 336 1061: 182, 337 1062: 165, 338 1063: 252, 339 1064: 246, 340 1065: 250, 341 1066: 159, 342 1067: 242, 343 1068: 238, 344 1069: 248, 345 1070: 157, 346 1071: 224, 347 1072: 160, 348 1073: 162, 349 1074: 235, 350 1075: 172, 351 1076: 166, 352 1077: 168, 353 1078: 233, 354 1079: 243, 355 1080: 183, 356 1081: 189, 357 1082: 198, 358 1083: 208, 359 1084: 210, 360 1085: 212, 361 1086: 214, 362 1087: 216, 363 1088: 225, 364 1089: 227, 365 1090: 229, 366 1091: 231, 367 1092: 170, 368 1093: 181, 369 1094: 164, 370 1095: 251, 371 1096: 245, 372 1097: 249, 373 1098: 158, 374 1099: 241, 375 1100: 237, 376 1101: 247, 377 1102: 156, 378 1103: 222, 379 1105: 132, 380 1106: 128, 381 1107: 130, 382 1108: 134, 383 1109: 136, 384 1110: 138, 385 1111: 140, 386 1112: 142, 387 1113: 144, 388 1114: 146, 389 1115: 148, 390 1116: 150, 391 1118: 152, 392 1119: 154, 393 8470: 239, 394 9472: 196, 395 9474: 179, 396 9484: 218, 397 9488: 191, 398 9492: 192, 399 9496: 217, 400 9500: 195, 401 9508: 180, 402 9516: 194, 403 9524: 193, 404 9532: 197, 405 9552: 205, 406 9553: 186, 407 9556: 201, 408 9559: 187, 409 9562: 200, 410 9565: 188, 411 9568: 204, 412 9571: 185, 413 9574: 203, 414 9577: 202, 415 9580: 206, 416 9600: 223, 417 9604: 220, 418 9608: 219, 419 9617: 176, 420 9618: 177, 421 9619: 178, 422 9632: 254}