Back to index

python3.2  3.2.2
cp424.py
Go to the documentation of this file.
00001 """ Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.TXT' with gencodec.py.
00002 
00003 """#"
00004 
00005 import codecs
00006 
00007 ### Codec APIs
00008 
00009 class Codec(codecs.Codec):
00010 
00011     def encode(self,input,errors='strict'):
00012         return codecs.charmap_encode(input,errors,encoding_table)
00013 
00014     def decode(self,input,errors='strict'):
00015         return codecs.charmap_decode(input,errors,decoding_table)
00016 
00017 class IncrementalEncoder(codecs.IncrementalEncoder):
00018     def encode(self, input, final=False):
00019         return codecs.charmap_encode(input,self.errors,encoding_table)[0]
00020 
00021 class IncrementalDecoder(codecs.IncrementalDecoder):
00022     def decode(self, input, final=False):
00023         return codecs.charmap_decode(input,self.errors,decoding_table)[0]
00024 
00025 class StreamWriter(Codec,codecs.StreamWriter):
00026     pass
00027 
00028 class StreamReader(Codec,codecs.StreamReader):
00029     pass
00030 
00031 ### encodings module API
00032 
00033 def getregentry():
00034     return codecs.CodecInfo(
00035         name='cp424',
00036         encode=Codec().encode,
00037         decode=Codec().decode,
00038         incrementalencoder=IncrementalEncoder,
00039         incrementaldecoder=IncrementalDecoder,
00040         streamreader=StreamReader,
00041         streamwriter=StreamWriter,
00042     )
00043 
00044 
00045 ### Decoding Table
00046 
00047 decoding_table = (
00048     '\x00'     #  0x00 -> NULL
00049     '\x01'     #  0x01 -> START OF HEADING
00050     '\x02'     #  0x02 -> START OF TEXT
00051     '\x03'     #  0x03 -> END OF TEXT
00052     '\x9c'     #  0x04 -> SELECT
00053     '\t'       #  0x05 -> HORIZONTAL TABULATION
00054     '\x86'     #  0x06 -> REQUIRED NEW LINE
00055     '\x7f'     #  0x07 -> DELETE
00056     '\x97'     #  0x08 -> GRAPHIC ESCAPE
00057     '\x8d'     #  0x09 -> SUPERSCRIPT
00058     '\x8e'     #  0x0A -> REPEAT
00059     '\x0b'     #  0x0B -> VERTICAL TABULATION
00060     '\x0c'     #  0x0C -> FORM FEED
00061     '\r'       #  0x0D -> CARRIAGE RETURN
00062     '\x0e'     #  0x0E -> SHIFT OUT
00063     '\x0f'     #  0x0F -> SHIFT IN
00064     '\x10'     #  0x10 -> DATA LINK ESCAPE
00065     '\x11'     #  0x11 -> DEVICE CONTROL ONE
00066     '\x12'     #  0x12 -> DEVICE CONTROL TWO
00067     '\x13'     #  0x13 -> DEVICE CONTROL THREE
00068     '\x9d'     #  0x14 -> RESTORE/ENABLE PRESENTATION
00069     '\x85'     #  0x15 -> NEW LINE
00070     '\x08'     #  0x16 -> BACKSPACE
00071     '\x87'     #  0x17 -> PROGRAM OPERATOR COMMUNICATION
00072     '\x18'     #  0x18 -> CANCEL
00073     '\x19'     #  0x19 -> END OF MEDIUM
00074     '\x92'     #  0x1A -> UNIT BACK SPACE
00075     '\x8f'     #  0x1B -> CUSTOMER USE ONE
00076     '\x1c'     #  0x1C -> FILE SEPARATOR
00077     '\x1d'     #  0x1D -> GROUP SEPARATOR
00078     '\x1e'     #  0x1E -> RECORD SEPARATOR
00079     '\x1f'     #  0x1F -> UNIT SEPARATOR
00080     '\x80'     #  0x20 -> DIGIT SELECT
00081     '\x81'     #  0x21 -> START OF SIGNIFICANCE
00082     '\x82'     #  0x22 -> FIELD SEPARATOR
00083     '\x83'     #  0x23 -> WORD UNDERSCORE
00084     '\x84'     #  0x24 -> BYPASS OR INHIBIT PRESENTATION
00085     '\n'       #  0x25 -> LINE FEED
00086     '\x17'     #  0x26 -> END OF TRANSMISSION BLOCK
00087     '\x1b'     #  0x27 -> ESCAPE
00088     '\x88'     #  0x28 -> SET ATTRIBUTE
00089     '\x89'     #  0x29 -> START FIELD EXTENDED
00090     '\x8a'     #  0x2A -> SET MODE OR SWITCH
00091     '\x8b'     #  0x2B -> CONTROL SEQUENCE PREFIX
00092     '\x8c'     #  0x2C -> MODIFY FIELD ATTRIBUTE
00093     '\x05'     #  0x2D -> ENQUIRY
00094     '\x06'     #  0x2E -> ACKNOWLEDGE
00095     '\x07'     #  0x2F -> BELL
00096     '\x90'     #  0x30 -> <reserved>
00097     '\x91'     #  0x31 -> <reserved>
00098     '\x16'     #  0x32 -> SYNCHRONOUS IDLE
00099     '\x93'     #  0x33 -> INDEX RETURN
00100     '\x94'     #  0x34 -> PRESENTATION POSITION
00101     '\x95'     #  0x35 -> TRANSPARENT
00102     '\x96'     #  0x36 -> NUMERIC BACKSPACE
00103     '\x04'     #  0x37 -> END OF TRANSMISSION
00104     '\x98'     #  0x38 -> SUBSCRIPT
00105     '\x99'     #  0x39 -> INDENT TABULATION
00106     '\x9a'     #  0x3A -> REVERSE FORM FEED
00107     '\x9b'     #  0x3B -> CUSTOMER USE THREE
00108     '\x14'     #  0x3C -> DEVICE CONTROL FOUR
00109     '\x15'     #  0x3D -> NEGATIVE ACKNOWLEDGE
00110     '\x9e'     #  0x3E -> <reserved>
00111     '\x1a'     #  0x3F -> SUBSTITUTE
00112     ' '        #  0x40 -> SPACE
00113     '\u05d0'   #  0x41 -> HEBREW LETTER ALEF
00114     '\u05d1'   #  0x42 -> HEBREW LETTER BET
00115     '\u05d2'   #  0x43 -> HEBREW LETTER GIMEL
00116     '\u05d3'   #  0x44 -> HEBREW LETTER DALET
00117     '\u05d4'   #  0x45 -> HEBREW LETTER HE
00118     '\u05d5'   #  0x46 -> HEBREW LETTER VAV
00119     '\u05d6'   #  0x47 -> HEBREW LETTER ZAYIN
00120     '\u05d7'   #  0x48 -> HEBREW LETTER HET
00121     '\u05d8'   #  0x49 -> HEBREW LETTER TET
00122     '\xa2'     #  0x4A -> CENT SIGN
00123     '.'        #  0x4B -> FULL STOP
00124     '<'        #  0x4C -> LESS-THAN SIGN
00125     '('        #  0x4D -> LEFT PARENTHESIS
00126     '+'        #  0x4E -> PLUS SIGN
00127     '|'        #  0x4F -> VERTICAL LINE
00128     '&'        #  0x50 -> AMPERSAND
00129     '\u05d9'   #  0x51 -> HEBREW LETTER YOD
00130     '\u05da'   #  0x52 -> HEBREW LETTER FINAL KAF
00131     '\u05db'   #  0x53 -> HEBREW LETTER KAF
00132     '\u05dc'   #  0x54 -> HEBREW LETTER LAMED
00133     '\u05dd'   #  0x55 -> HEBREW LETTER FINAL MEM
00134     '\u05de'   #  0x56 -> HEBREW LETTER MEM
00135     '\u05df'   #  0x57 -> HEBREW LETTER FINAL NUN
00136     '\u05e0'   #  0x58 -> HEBREW LETTER NUN
00137     '\u05e1'   #  0x59 -> HEBREW LETTER SAMEKH
00138     '!'        #  0x5A -> EXCLAMATION MARK
00139     '$'        #  0x5B -> DOLLAR SIGN
00140     '*'        #  0x5C -> ASTERISK
00141     ')'        #  0x5D -> RIGHT PARENTHESIS
00142     ';'        #  0x5E -> SEMICOLON
00143     '\xac'     #  0x5F -> NOT SIGN
00144     '-'        #  0x60 -> HYPHEN-MINUS
00145     '/'        #  0x61 -> SOLIDUS
00146     '\u05e2'   #  0x62 -> HEBREW LETTER AYIN
00147     '\u05e3'   #  0x63 -> HEBREW LETTER FINAL PE
00148     '\u05e4'   #  0x64 -> HEBREW LETTER PE
00149     '\u05e5'   #  0x65 -> HEBREW LETTER FINAL TSADI
00150     '\u05e6'   #  0x66 -> HEBREW LETTER TSADI
00151     '\u05e7'   #  0x67 -> HEBREW LETTER QOF
00152     '\u05e8'   #  0x68 -> HEBREW LETTER RESH
00153     '\u05e9'   #  0x69 -> HEBREW LETTER SHIN
00154     '\xa6'     #  0x6A -> BROKEN BAR
00155     ','        #  0x6B -> COMMA
00156     '%'        #  0x6C -> PERCENT SIGN
00157     '_'        #  0x6D -> LOW LINE
00158     '>'        #  0x6E -> GREATER-THAN SIGN
00159     '?'        #  0x6F -> QUESTION MARK
00160     '\ufffe'   #  0x70 -> UNDEFINED
00161     '\u05ea'   #  0x71 -> HEBREW LETTER TAV
00162     '\ufffe'   #  0x72 -> UNDEFINED
00163     '\ufffe'   #  0x73 -> UNDEFINED
00164     '\xa0'     #  0x74 -> NO-BREAK SPACE
00165     '\ufffe'   #  0x75 -> UNDEFINED
00166     '\ufffe'   #  0x76 -> UNDEFINED
00167     '\ufffe'   #  0x77 -> UNDEFINED
00168     '\u2017'   #  0x78 -> DOUBLE LOW LINE
00169     '`'        #  0x79 -> GRAVE ACCENT
00170     ':'        #  0x7A -> COLON
00171     '#'        #  0x7B -> NUMBER SIGN
00172     '@'        #  0x7C -> COMMERCIAL AT
00173     "'"        #  0x7D -> APOSTROPHE
00174     '='        #  0x7E -> EQUALS SIGN
00175     '"'        #  0x7F -> QUOTATION MARK
00176     '\ufffe'   #  0x80 -> UNDEFINED
00177     'a'        #  0x81 -> LATIN SMALL LETTER A
00178     'b'        #  0x82 -> LATIN SMALL LETTER B
00179     'c'        #  0x83 -> LATIN SMALL LETTER C
00180     'd'        #  0x84 -> LATIN SMALL LETTER D
00181     'e'        #  0x85 -> LATIN SMALL LETTER E
00182     'f'        #  0x86 -> LATIN SMALL LETTER F
00183     'g'        #  0x87 -> LATIN SMALL LETTER G
00184     'h'        #  0x88 -> LATIN SMALL LETTER H
00185     'i'        #  0x89 -> LATIN SMALL LETTER I
00186     '\xab'     #  0x8A -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
00187     '\xbb'     #  0x8B -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
00188     '\ufffe'   #  0x8C -> UNDEFINED
00189     '\ufffe'   #  0x8D -> UNDEFINED
00190     '\ufffe'   #  0x8E -> UNDEFINED
00191     '\xb1'     #  0x8F -> PLUS-MINUS SIGN
00192     '\xb0'     #  0x90 -> DEGREE SIGN
00193     'j'        #  0x91 -> LATIN SMALL LETTER J
00194     'k'        #  0x92 -> LATIN SMALL LETTER K
00195     'l'        #  0x93 -> LATIN SMALL LETTER L
00196     'm'        #  0x94 -> LATIN SMALL LETTER M
00197     'n'        #  0x95 -> LATIN SMALL LETTER N
00198     'o'        #  0x96 -> LATIN SMALL LETTER O
00199     'p'        #  0x97 -> LATIN SMALL LETTER P
00200     'q'        #  0x98 -> LATIN SMALL LETTER Q
00201     'r'        #  0x99 -> LATIN SMALL LETTER R
00202     '\ufffe'   #  0x9A -> UNDEFINED
00203     '\ufffe'   #  0x9B -> UNDEFINED
00204     '\ufffe'   #  0x9C -> UNDEFINED
00205     '\xb8'     #  0x9D -> CEDILLA
00206     '\ufffe'   #  0x9E -> UNDEFINED
00207     '\xa4'     #  0x9F -> CURRENCY SIGN
00208     '\xb5'     #  0xA0 -> MICRO SIGN
00209     '~'        #  0xA1 -> TILDE
00210     's'        #  0xA2 -> LATIN SMALL LETTER S
00211     't'        #  0xA3 -> LATIN SMALL LETTER T
00212     'u'        #  0xA4 -> LATIN SMALL LETTER U
00213     'v'        #  0xA5 -> LATIN SMALL LETTER V
00214     'w'        #  0xA6 -> LATIN SMALL LETTER W
00215     'x'        #  0xA7 -> LATIN SMALL LETTER X
00216     'y'        #  0xA8 -> LATIN SMALL LETTER Y
00217     'z'        #  0xA9 -> LATIN SMALL LETTER Z
00218     '\ufffe'   #  0xAA -> UNDEFINED
00219     '\ufffe'   #  0xAB -> UNDEFINED
00220     '\ufffe'   #  0xAC -> UNDEFINED
00221     '\ufffe'   #  0xAD -> UNDEFINED
00222     '\ufffe'   #  0xAE -> UNDEFINED
00223     '\xae'     #  0xAF -> REGISTERED SIGN
00224     '^'        #  0xB0 -> CIRCUMFLEX ACCENT
00225     '\xa3'     #  0xB1 -> POUND SIGN
00226     '\xa5'     #  0xB2 -> YEN SIGN
00227     '\xb7'     #  0xB3 -> MIDDLE DOT
00228     '\xa9'     #  0xB4 -> COPYRIGHT SIGN
00229     '\xa7'     #  0xB5 -> SECTION SIGN
00230     '\xb6'     #  0xB6 -> PILCROW SIGN
00231     '\xbc'     #  0xB7 -> VULGAR FRACTION ONE QUARTER
00232     '\xbd'     #  0xB8 -> VULGAR FRACTION ONE HALF
00233     '\xbe'     #  0xB9 -> VULGAR FRACTION THREE QUARTERS
00234     '['        #  0xBA -> LEFT SQUARE BRACKET
00235     ']'        #  0xBB -> RIGHT SQUARE BRACKET
00236     '\xaf'     #  0xBC -> MACRON
00237     '\xa8'     #  0xBD -> DIAERESIS
00238     '\xb4'     #  0xBE -> ACUTE ACCENT
00239     '\xd7'     #  0xBF -> MULTIPLICATION SIGN
00240     '{'        #  0xC0 -> LEFT CURLY BRACKET
00241     'A'        #  0xC1 -> LATIN CAPITAL LETTER A
00242     'B'        #  0xC2 -> LATIN CAPITAL LETTER B
00243     'C'        #  0xC3 -> LATIN CAPITAL LETTER C
00244     'D'        #  0xC4 -> LATIN CAPITAL LETTER D
00245     'E'        #  0xC5 -> LATIN CAPITAL LETTER E
00246     'F'        #  0xC6 -> LATIN CAPITAL LETTER F
00247     'G'        #  0xC7 -> LATIN CAPITAL LETTER G
00248     'H'        #  0xC8 -> LATIN CAPITAL LETTER H
00249     'I'        #  0xC9 -> LATIN CAPITAL LETTER I
00250     '\xad'     #  0xCA -> SOFT HYPHEN
00251     '\ufffe'   #  0xCB -> UNDEFINED
00252     '\ufffe'   #  0xCC -> UNDEFINED
00253     '\ufffe'   #  0xCD -> UNDEFINED
00254     '\ufffe'   #  0xCE -> UNDEFINED
00255     '\ufffe'   #  0xCF -> UNDEFINED
00256     '}'        #  0xD0 -> RIGHT CURLY BRACKET
00257     'J'        #  0xD1 -> LATIN CAPITAL LETTER J
00258     'K'        #  0xD2 -> LATIN CAPITAL LETTER K
00259     'L'        #  0xD3 -> LATIN CAPITAL LETTER L
00260     'M'        #  0xD4 -> LATIN CAPITAL LETTER M
00261     'N'        #  0xD5 -> LATIN CAPITAL LETTER N
00262     'O'        #  0xD6 -> LATIN CAPITAL LETTER O
00263     'P'        #  0xD7 -> LATIN CAPITAL LETTER P
00264     'Q'        #  0xD8 -> LATIN CAPITAL LETTER Q
00265     'R'        #  0xD9 -> LATIN CAPITAL LETTER R
00266     '\xb9'     #  0xDA -> SUPERSCRIPT ONE
00267     '\ufffe'   #  0xDB -> UNDEFINED
00268     '\ufffe'   #  0xDC -> UNDEFINED
00269     '\ufffe'   #  0xDD -> UNDEFINED
00270     '\ufffe'   #  0xDE -> UNDEFINED
00271     '\ufffe'   #  0xDF -> UNDEFINED
00272     '\\'       #  0xE0 -> REVERSE SOLIDUS
00273     '\xf7'     #  0xE1 -> DIVISION SIGN
00274     'S'        #  0xE2 -> LATIN CAPITAL LETTER S
00275     'T'        #  0xE3 -> LATIN CAPITAL LETTER T
00276     'U'        #  0xE4 -> LATIN CAPITAL LETTER U
00277     'V'        #  0xE5 -> LATIN CAPITAL LETTER V
00278     'W'        #  0xE6 -> LATIN CAPITAL LETTER W
00279     'X'        #  0xE7 -> LATIN CAPITAL LETTER X
00280     'Y'        #  0xE8 -> LATIN CAPITAL LETTER Y
00281     'Z'        #  0xE9 -> LATIN CAPITAL LETTER Z
00282     '\xb2'     #  0xEA -> SUPERSCRIPT TWO
00283     '\ufffe'   #  0xEB -> UNDEFINED
00284     '\ufffe'   #  0xEC -> UNDEFINED
00285     '\ufffe'   #  0xED -> UNDEFINED
00286     '\ufffe'   #  0xEE -> UNDEFINED
00287     '\ufffe'   #  0xEF -> UNDEFINED
00288     '0'        #  0xF0 -> DIGIT ZERO
00289     '1'        #  0xF1 -> DIGIT ONE
00290     '2'        #  0xF2 -> DIGIT TWO
00291     '3'        #  0xF3 -> DIGIT THREE
00292     '4'        #  0xF4 -> DIGIT FOUR
00293     '5'        #  0xF5 -> DIGIT FIVE
00294     '6'        #  0xF6 -> DIGIT SIX
00295     '7'        #  0xF7 -> DIGIT SEVEN
00296     '8'        #  0xF8 -> DIGIT EIGHT
00297     '9'        #  0xF9 -> DIGIT NINE
00298     '\xb3'     #  0xFA -> SUPERSCRIPT THREE
00299     '\ufffe'   #  0xFB -> UNDEFINED
00300     '\ufffe'   #  0xFC -> UNDEFINED
00301     '\ufffe'   #  0xFD -> UNDEFINED
00302     '\ufffe'   #  0xFE -> UNDEFINED
00303     '\x9f'     #  0xFF -> EIGHT ONES
00304 )
00305 
00306 ### Encoding table
00307 encoding_table=codecs.charmap_build(decoding_table)