mac_arabic.py (6128B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\carbon\common\stdlib\encodings\mac_arabic.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='mac-arabic', 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: 196, 39 129: 160, 40 130: 199, 41 131: 201, 42 132: 209, 43 133: 214, 44 134: 220, 45 135: 225, 46 136: 224, 47 137: 226, 48 138: 228, 49 139: 1722, 50 140: 171, 51 141: 231, 52 142: 233, 53 143: 232, 54 144: 234, 55 145: 235, 56 146: 237, 57 147: 8230, 58 148: 238, 59 149: 239, 60 150: 241, 61 151: 243, 62 152: 187, 63 153: 244, 64 154: 246, 65 155: 247, 66 156: 250, 67 157: 249, 68 158: 251, 69 159: 252, 70 160: 32, 71 161: 33, 72 162: 34, 73 163: 35, 74 164: 36, 75 165: 1642, 76 166: 38, 77 167: 39, 78 168: 40, 79 169: 41, 80 170: 42, 81 171: 43, 82 172: 1548, 83 173: 45, 84 174: 46, 85 175: 47, 86 176: 1632, 87 177: 1633, 88 178: 1634, 89 179: 1635, 90 180: 1636, 91 181: 1637, 92 182: 1638, 93 183: 1639, 94 184: 1640, 95 185: 1641, 96 186: 58, 97 187: 1563, 98 188: 60, 99 189: 61, 100 190: 62, 101 191: 1567, 102 192: 10058, 103 193: 1569, 104 194: 1570, 105 195: 1571, 106 196: 1572, 107 197: 1573, 108 198: 1574, 109 199: 1575, 110 200: 1576, 111 201: 1577, 112 202: 1578, 113 203: 1579, 114 204: 1580, 115 205: 1581, 116 206: 1582, 117 207: 1583, 118 208: 1584, 119 209: 1585, 120 210: 1586, 121 211: 1587, 122 212: 1588, 123 213: 1589, 124 214: 1590, 125 215: 1591, 126 216: 1592, 127 217: 1593, 128 218: 1594, 129 219: 91, 130 220: 92, 131 221: 93, 132 222: 94, 133 223: 95, 134 224: 1600, 135 225: 1601, 136 226: 1602, 137 227: 1603, 138 228: 1604, 139 229: 1605, 140 230: 1606, 141 231: 1607, 142 232: 1608, 143 233: 1609, 144 234: 1610, 145 235: 1611, 146 236: 1612, 147 237: 1613, 148 238: 1614, 149 239: 1615, 150 240: 1616, 151 241: 1617, 152 242: 1618, 153 243: 1662, 154 244: 1657, 155 245: 1670, 156 246: 1749, 157 247: 1700, 158 248: 1711, 159 249: 1672, 160 250: 1681, 161 251: 123, 162 252: 124, 163 253: 125, 164 254: 1688, 165 255: 1746}) 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\xc4\xa0\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\u06ba\xab\xe7\xe9\xe8\xea\xeb\xed\u2026\xee\xef\xf1\xf3\xbb\xf4\xf6\xf7\xfa\xf9\xfb\xfc !"#$\u066a&\'()*+\u060c-./\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669:\u061b<=>\u061f\u274a\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062a\u062b\u062c\u062d\u062e\u062f\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063a[\\]^_\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064a\u064b\u064c\u064d\u064e\u064f\u0650\u0651\u0652\u067e\u0679\u0686\u06d5\u06a4\u06af\u0688\u0691{|}\u0698\u06d2' 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 32: 160, 201 33: 33, 202 33: 161, 203 34: 34, 204 34: 162, 205 35: 35, 206 35: 163, 207 36: 36, 208 36: 164, 209 37: 37, 210 38: 38, 211 38: 166, 212 39: 39, 213 39: 167, 214 40: 40, 215 40: 168, 216 41: 41, 217 41: 169, 218 42: 42, 219 42: 170, 220 43: 43, 221 43: 171, 222 44: 44, 223 45: 45, 224 45: 173, 225 46: 46, 226 46: 174, 227 47: 47, 228 47: 175, 229 48: 48, 230 49: 49, 231 50: 50, 232 51: 51, 233 52: 52, 234 53: 53, 235 54: 54, 236 55: 55, 237 56: 56, 238 57: 57, 239 58: 58, 240 58: 186, 241 59: 59, 242 60: 60, 243 60: 188, 244 61: 61, 245 61: 189, 246 62: 62, 247 62: 190, 248 63: 63, 249 64: 64, 250 65: 65, 251 66: 66, 252 67: 67, 253 68: 68, 254 69: 69, 255 70: 70, 256 71: 71, 257 72: 72, 258 73: 73, 259 74: 74, 260 75: 75, 261 76: 76, 262 77: 77, 263 78: 78, 264 79: 79, 265 80: 80, 266 81: 81, 267 82: 82, 268 83: 83, 269 84: 84, 270 85: 85, 271 86: 86, 272 87: 87, 273 88: 88, 274 89: 89, 275 90: 90, 276 91: 91, 277 91: 219, 278 92: 92, 279 92: 220, 280 93: 93, 281 93: 221, 282 94: 94, 283 94: 222, 284 95: 95, 285 95: 223, 286 96: 96, 287 97: 97, 288 98: 98, 289 99: 99, 290 100: 100, 291 101: 101, 292 102: 102, 293 103: 103, 294 104: 104, 295 105: 105, 296 106: 106, 297 107: 107, 298 108: 108, 299 109: 109, 300 110: 110, 301 111: 111, 302 112: 112, 303 113: 113, 304 114: 114, 305 115: 115, 306 116: 116, 307 117: 117, 308 118: 118, 309 119: 119, 310 120: 120, 311 121: 121, 312 122: 122, 313 123: 123, 314 123: 251, 315 124: 124, 316 124: 252, 317 125: 125, 318 125: 253, 319 126: 126, 320 127: 127, 321 160: 129, 322 171: 140, 323 187: 152, 324 196: 128, 325 199: 130, 326 201: 131, 327 209: 132, 328 214: 133, 329 220: 134, 330 224: 136, 331 225: 135, 332 226: 137, 333 228: 138, 334 231: 141, 335 232: 143, 336 233: 142, 337 234: 144, 338 235: 145, 339 237: 146, 340 238: 148, 341 239: 149, 342 241: 150, 343 243: 151, 344 244: 153, 345 246: 154, 346 247: 155, 347 249: 157, 348 250: 156, 349 251: 158, 350 252: 159, 351 1548: 172, 352 1563: 187, 353 1567: 191, 354 1569: 193, 355 1570: 194, 356 1571: 195, 357 1572: 196, 358 1573: 197, 359 1574: 198, 360 1575: 199, 361 1576: 200, 362 1577: 201, 363 1578: 202, 364 1579: 203, 365 1580: 204, 366 1581: 205, 367 1582: 206, 368 1583: 207, 369 1584: 208, 370 1585: 209, 371 1586: 210, 372 1587: 211, 373 1588: 212, 374 1589: 213, 375 1590: 214, 376 1591: 215, 377 1592: 216, 378 1593: 217, 379 1594: 218, 380 1600: 224, 381 1601: 225, 382 1602: 226, 383 1603: 227, 384 1604: 228, 385 1605: 229, 386 1606: 230, 387 1607: 231, 388 1608: 232, 389 1609: 233, 390 1610: 234, 391 1611: 235, 392 1612: 236, 393 1613: 237, 394 1614: 238, 395 1615: 239, 396 1616: 240, 397 1617: 241, 398 1618: 242, 399 1632: 176, 400 1633: 177, 401 1634: 178, 402 1635: 179, 403 1636: 180, 404 1637: 181, 405 1638: 182, 406 1639: 183, 407 1640: 184, 408 1641: 185, 409 1642: 165, 410 1657: 244, 411 1662: 243, 412 1670: 245, 413 1672: 249, 414 1681: 250, 415 1688: 254, 416 1700: 247, 417 1711: 248, 418 1722: 139, 419 1746: 255, 420 1749: 246, 421 8230: 147, 422 10058: 192}