Marc-André Lemburg | a866df8 | 2001-01-03 21:29:14 +0000 | [diff] [blame] | 1 | """ Python Character Mapping Codec generated from 'CP1006.TXT' with gencodec.py. |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 2 | |
| 3 | Written by Marc-Andre Lemburg (mal@lemburg.com). |
| 4 | |
| 5 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. |
Marc-André Lemburg | a866df8 | 2001-01-03 21:29:14 +0000 | [diff] [blame] | 6 | (c) Copyright 2000 Guido van Rossum. |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 7 | |
| 8 | """#" |
| 9 | |
| 10 | import codecs |
| 11 | |
| 12 | ### Codec APIs |
| 13 | |
| 14 | class Codec(codecs.Codec): |
| 15 | |
| 16 | def encode(self,input,errors='strict'): |
| 17 | |
| 18 | return codecs.charmap_encode(input,errors,encoding_map) |
Tim Peters | 469cdad | 2002-08-08 20:19:19 +0000 | [diff] [blame] | 19 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 20 | def decode(self,input,errors='strict'): |
| 21 | |
| 22 | return codecs.charmap_decode(input,errors,decoding_map) |
| 23 | |
| 24 | class StreamWriter(Codec,codecs.StreamWriter): |
| 25 | pass |
Tim Peters | 469cdad | 2002-08-08 20:19:19 +0000 | [diff] [blame] | 26 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 27 | class StreamReader(Codec,codecs.StreamReader): |
| 28 | pass |
| 29 | |
| 30 | ### encodings module API |
| 31 | |
| 32 | def getregentry(): |
| 33 | |
| 34 | return (Codec().encode,Codec().decode,StreamReader,StreamWriter) |
| 35 | |
| 36 | ### Decoding Map |
| 37 | |
Marc-André Lemburg | a866df8 | 2001-01-03 21:29:14 +0000 | [diff] [blame] | 38 | decoding_map = codecs.make_identity_dict(range(256)) |
| 39 | decoding_map.update({ |
Tim Peters | 469cdad | 2002-08-08 20:19:19 +0000 | [diff] [blame] | 40 | 0x00a1: 0x06f0, # EXTENDED ARABIC-INDIC DIGIT ZERO |
| 41 | 0x00a2: 0x06f1, # EXTENDED ARABIC-INDIC DIGIT ONE |
| 42 | 0x00a3: 0x06f2, # EXTENDED ARABIC-INDIC DIGIT TWO |
| 43 | 0x00a4: 0x06f3, # EXTENDED ARABIC-INDIC DIGIT THREE |
| 44 | 0x00a5: 0x06f4, # EXTENDED ARABIC-INDIC DIGIT FOUR |
| 45 | 0x00a6: 0x06f5, # EXTENDED ARABIC-INDIC DIGIT FIVE |
| 46 | 0x00a7: 0x06f6, # EXTENDED ARABIC-INDIC DIGIT SIX |
| 47 | 0x00a8: 0x06f7, # EXTENDED ARABIC-INDIC DIGIT SEVEN |
| 48 | 0x00a9: 0x06f8, # EXTENDED ARABIC-INDIC DIGIT EIGHT |
| 49 | 0x00aa: 0x06f9, # EXTENDED ARABIC-INDIC DIGIT NINE |
| 50 | 0x00ab: 0x060c, # ARABIC COMMA |
| 51 | 0x00ac: 0x061b, # ARABIC SEMICOLON |
| 52 | 0x00ae: 0x061f, # ARABIC QUESTION MARK |
| 53 | 0x00af: 0xfe81, # ARABIC LETTER ALEF WITH MADDA ABOVE ISOLATED FORM |
| 54 | 0x00b0: 0xfe8d, # ARABIC LETTER ALEF ISOLATED FORM |
| 55 | 0x00b1: 0xfe8e, # ARABIC LETTER ALEF FINAL FORM |
| 56 | 0x00b2: 0xfe8e, # ARABIC LETTER ALEF FINAL FORM |
| 57 | 0x00b3: 0xfe8f, # ARABIC LETTER BEH ISOLATED FORM |
| 58 | 0x00b4: 0xfe91, # ARABIC LETTER BEH INITIAL FORM |
| 59 | 0x00b5: 0xfb56, # ARABIC LETTER PEH ISOLATED FORM |
| 60 | 0x00b6: 0xfb58, # ARABIC LETTER PEH INITIAL FORM |
| 61 | 0x00b7: 0xfe93, # ARABIC LETTER TEH MARBUTA ISOLATED FORM |
| 62 | 0x00b8: 0xfe95, # ARABIC LETTER TEH ISOLATED FORM |
| 63 | 0x00b9: 0xfe97, # ARABIC LETTER TEH INITIAL FORM |
| 64 | 0x00ba: 0xfb66, # ARABIC LETTER TTEH ISOLATED FORM |
| 65 | 0x00bb: 0xfb68, # ARABIC LETTER TTEH INITIAL FORM |
| 66 | 0x00bc: 0xfe99, # ARABIC LETTER THEH ISOLATED FORM |
| 67 | 0x00bd: 0xfe9b, # ARABIC LETTER THEH INITIAL FORM |
| 68 | 0x00be: 0xfe9d, # ARABIC LETTER JEEM ISOLATED FORM |
| 69 | 0x00bf: 0xfe9f, # ARABIC LETTER JEEM INITIAL FORM |
| 70 | 0x00c0: 0xfb7a, # ARABIC LETTER TCHEH ISOLATED FORM |
| 71 | 0x00c1: 0xfb7c, # ARABIC LETTER TCHEH INITIAL FORM |
| 72 | 0x00c2: 0xfea1, # ARABIC LETTER HAH ISOLATED FORM |
| 73 | 0x00c3: 0xfea3, # ARABIC LETTER HAH INITIAL FORM |
| 74 | 0x00c4: 0xfea5, # ARABIC LETTER KHAH ISOLATED FORM |
| 75 | 0x00c5: 0xfea7, # ARABIC LETTER KHAH INITIAL FORM |
| 76 | 0x00c6: 0xfea9, # ARABIC LETTER DAL ISOLATED FORM |
| 77 | 0x00c7: 0xfb84, # ARABIC LETTER DAHAL ISOLATED FORMN |
| 78 | 0x00c8: 0xfeab, # ARABIC LETTER THAL ISOLATED FORM |
| 79 | 0x00c9: 0xfead, # ARABIC LETTER REH ISOLATED FORM |
| 80 | 0x00ca: 0xfb8c, # ARABIC LETTER RREH ISOLATED FORM |
| 81 | 0x00cb: 0xfeaf, # ARABIC LETTER ZAIN ISOLATED FORM |
| 82 | 0x00cc: 0xfb8a, # ARABIC LETTER JEH ISOLATED FORM |
| 83 | 0x00cd: 0xfeb1, # ARABIC LETTER SEEN ISOLATED FORM |
| 84 | 0x00ce: 0xfeb3, # ARABIC LETTER SEEN INITIAL FORM |
| 85 | 0x00cf: 0xfeb5, # ARABIC LETTER SHEEN ISOLATED FORM |
| 86 | 0x00d0: 0xfeb7, # ARABIC LETTER SHEEN INITIAL FORM |
| 87 | 0x00d1: 0xfeb9, # ARABIC LETTER SAD ISOLATED FORM |
| 88 | 0x00d2: 0xfebb, # ARABIC LETTER SAD INITIAL FORM |
| 89 | 0x00d3: 0xfebd, # ARABIC LETTER DAD ISOLATED FORM |
| 90 | 0x00d4: 0xfebf, # ARABIC LETTER DAD INITIAL FORM |
| 91 | 0x00d5: 0xfec1, # ARABIC LETTER TAH ISOLATED FORM |
| 92 | 0x00d6: 0xfec5, # ARABIC LETTER ZAH ISOLATED FORM |
| 93 | 0x00d7: 0xfec9, # ARABIC LETTER AIN ISOLATED FORM |
| 94 | 0x00d8: 0xfeca, # ARABIC LETTER AIN FINAL FORM |
| 95 | 0x00d9: 0xfecb, # ARABIC LETTER AIN INITIAL FORM |
| 96 | 0x00da: 0xfecc, # ARABIC LETTER AIN MEDIAL FORM |
| 97 | 0x00db: 0xfecd, # ARABIC LETTER GHAIN ISOLATED FORM |
| 98 | 0x00dc: 0xfece, # ARABIC LETTER GHAIN FINAL FORM |
| 99 | 0x00dd: 0xfecf, # ARABIC LETTER GHAIN INITIAL FORM |
| 100 | 0x00de: 0xfed0, # ARABIC LETTER GHAIN MEDIAL FORM |
| 101 | 0x00df: 0xfed1, # ARABIC LETTER FEH ISOLATED FORM |
| 102 | 0x00e0: 0xfed3, # ARABIC LETTER FEH INITIAL FORM |
| 103 | 0x00e1: 0xfed5, # ARABIC LETTER QAF ISOLATED FORM |
| 104 | 0x00e2: 0xfed7, # ARABIC LETTER QAF INITIAL FORM |
| 105 | 0x00e3: 0xfed9, # ARABIC LETTER KAF ISOLATED FORM |
| 106 | 0x00e4: 0xfedb, # ARABIC LETTER KAF INITIAL FORM |
| 107 | 0x00e5: 0xfb92, # ARABIC LETTER GAF ISOLATED FORM |
| 108 | 0x00e6: 0xfb94, # ARABIC LETTER GAF INITIAL FORM |
| 109 | 0x00e7: 0xfedd, # ARABIC LETTER LAM ISOLATED FORM |
| 110 | 0x00e8: 0xfedf, # ARABIC LETTER LAM INITIAL FORM |
| 111 | 0x00e9: 0xfee0, # ARABIC LETTER LAM MEDIAL FORM |
| 112 | 0x00ea: 0xfee1, # ARABIC LETTER MEEM ISOLATED FORM |
| 113 | 0x00eb: 0xfee3, # ARABIC LETTER MEEM INITIAL FORM |
| 114 | 0x00ec: 0xfb9e, # ARABIC LETTER NOON GHUNNA ISOLATED FORM |
| 115 | 0x00ed: 0xfee5, # ARABIC LETTER NOON ISOLATED FORM |
| 116 | 0x00ee: 0xfee7, # ARABIC LETTER NOON INITIAL FORM |
| 117 | 0x00ef: 0xfe85, # ARABIC LETTER WAW WITH HAMZA ABOVE ISOLATED FORM |
| 118 | 0x00f0: 0xfeed, # ARABIC LETTER WAW ISOLATED FORM |
| 119 | 0x00f1: 0xfba6, # ARABIC LETTER HEH GOAL ISOLATED FORM |
| 120 | 0x00f2: 0xfba8, # ARABIC LETTER HEH GOAL INITIAL FORM |
| 121 | 0x00f3: 0xfba9, # ARABIC LETTER HEH GOAL MEDIAL FORM |
| 122 | 0x00f4: 0xfbaa, # ARABIC LETTER HEH DOACHASHMEE ISOLATED FORM |
| 123 | 0x00f5: 0xfe80, # ARABIC LETTER HAMZA ISOLATED FORM |
| 124 | 0x00f6: 0xfe89, # ARABIC LETTER YEH WITH HAMZA ABOVE ISOLATED FORM |
| 125 | 0x00f7: 0xfe8a, # ARABIC LETTER YEH WITH HAMZA ABOVE FINAL FORM |
| 126 | 0x00f8: 0xfe8b, # ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM |
| 127 | 0x00f9: 0xfef1, # ARABIC LETTER YEH ISOLATED FORM |
| 128 | 0x00fa: 0xfef2, # ARABIC LETTER YEH FINAL FORM |
| 129 | 0x00fb: 0xfef3, # ARABIC LETTER YEH INITIAL FORM |
| 130 | 0x00fc: 0xfbb0, # ARABIC LETTER YEH BARREE WITH HAMZA ABOVE ISOLATED FORM |
| 131 | 0x00fd: 0xfbae, # ARABIC LETTER YEH BARREE ISOLATED FORM |
| 132 | 0x00fe: 0xfe7c, # ARABIC SHADDA ISOLATED FORM |
| 133 | 0x00ff: 0xfe7d, # ARABIC SHADDA MEDIAL FORM |
Marc-André Lemburg | a866df8 | 2001-01-03 21:29:14 +0000 | [diff] [blame] | 134 | }) |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 135 | |
| 136 | ### Encoding Map |
| 137 | |
Marc-André Lemburg | 716cf91 | 2001-05-16 09:41:45 +0000 | [diff] [blame] | 138 | encoding_map = codecs.make_encoding_map(decoding_map) |