123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py.
- """
- import codecs
- class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
- return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
- return codecs.charmap_decode(input,errors,decoding_table)
- class IncrementalEncoder(codecs.IncrementalEncoder):
- def encode(self, input, final=False):
- return codecs.charmap_encode(input,self.errors,encoding_table)[0]
- class IncrementalDecoder(codecs.IncrementalDecoder):
- def decode(self, input, final=False):
- return codecs.charmap_decode(input,self.errors,decoding_table)[0]
- class StreamWriter(Codec,codecs.StreamWriter):
- pass
- class StreamReader(Codec,codecs.StreamReader):
- pass
- def getregentry():
- return codecs.CodecInfo(
- name='cp875',
- encode=Codec().encode,
- decode=Codec().decode,
- incrementalencoder=IncrementalEncoder,
- incrementaldecoder=IncrementalDecoder,
- streamreader=StreamReader,
- streamwriter=StreamWriter,
- )
- decoding_table = (
- '\x00'
- '\x01'
- '\x02'
- '\x03'
- '\x9c'
- '\t'
- '\x86'
- '\x7f'
- '\x97'
- '\x8d'
- '\x8e'
- '\x0b'
- '\x0c'
- '\r'
- '\x0e'
- '\x0f'
- '\x10'
- '\x11'
- '\x12'
- '\x13'
- '\x9d'
- '\x85'
- '\x08'
- '\x87'
- '\x18'
- '\x19'
- '\x92'
- '\x8f'
- '\x1c'
- '\x1d'
- '\x1e'
- '\x1f'
- '\x80'
- '\x81'
- '\x82'
- '\x83'
- '\x84'
- '\n'
- '\x17'
- '\x1b'
- '\x88'
- '\x89'
- '\x8a'
- '\x8b'
- '\x8c'
- '\x05'
- '\x06'
- '\x07'
- '\x90'
- '\x91'
- '\x16'
- '\x93'
- '\x94'
- '\x95'
- '\x96'
- '\x04'
- '\x98'
- '\x99'
- '\x9a'
- '\x9b'
- '\x14'
- '\x15'
- '\x9e'
- '\x1a'
- ' '
- '\u0391'
- '\u0392'
- '\u0393'
- '\u0394'
- '\u0395'
- '\u0396'
- '\u0397'
- '\u0398'
- '\u0399'
- '['
- '.'
- '<'
- '('
- '+'
- '!'
- '&'
- '\u039a'
- '\u039b'
- '\u039c'
- '\u039d'
- '\u039e'
- '\u039f'
- '\u03a0'
- '\u03a1'
- '\u03a3'
- ']'
- '$'
- '*'
- ')'
- ';'
- '^'
- '-'
- '/'
- '\u03a4'
- '\u03a5'
- '\u03a6'
- '\u03a7'
- '\u03a8'
- '\u03a9'
- '\u03aa'
- '\u03ab'
- '|'
- ','
- '%'
- '_'
- '>'
- '?'
- '\xa8'
- '\u0386'
- '\u0388'
- '\u0389'
- '\xa0'
- '\u038a'
- '\u038c'
- '\u038e'
- '\u038f'
- '`'
- ':'
- '#'
- '@'
- "'"
- '='
- '"'
- '\u0385'
- 'a'
- 'b'
- 'c'
- 'd'
- 'e'
- 'f'
- 'g'
- 'h'
- 'i'
- '\u03b1'
- '\u03b2'
- '\u03b3'
- '\u03b4'
- '\u03b5'
- '\u03b6'
- '\xb0'
- 'j'
- 'k'
- 'l'
- 'm'
- 'n'
- 'o'
- 'p'
- 'q'
- 'r'
- '\u03b7'
- '\u03b8'
- '\u03b9'
- '\u03ba'
- '\u03bb'
- '\u03bc'
- '\xb4'
- '~'
- 's'
- 't'
- 'u'
- 'v'
- 'w'
- 'x'
- 'y'
- 'z'
- '\u03bd'
- '\u03be'
- '\u03bf'
- '\u03c0'
- '\u03c1'
- '\u03c3'
- '\xa3'
- '\u03ac'
- '\u03ad'
- '\u03ae'
- '\u03ca'
- '\u03af'
- '\u03cc'
- '\u03cd'
- '\u03cb'
- '\u03ce'
- '\u03c2'
- '\u03c4'
- '\u03c5'
- '\u03c6'
- '\u03c7'
- '\u03c8'
- '{'
- 'A'
- 'B'
- 'C'
- 'D'
- 'E'
- 'F'
- 'G'
- 'H'
- 'I'
- '\xad'
- '\u03c9'
- '\u0390'
- '\u03b0'
- '\u2018'
- '\u2015'
- '}'
- 'J'
- 'K'
- 'L'
- 'M'
- 'N'
- 'O'
- 'P'
- 'Q'
- 'R'
- '\xb1'
- '\xbd'
- '\x1a'
- '\u0387'
- '\u2019'
- '\xa6'
- '\\'
- '\x1a'
- 'S'
- 'T'
- 'U'
- 'V'
- 'W'
- 'X'
- 'Y'
- 'Z'
- '\xb2'
- '\xa7'
- '\x1a'
- '\x1a'
- '\xab'
- '\xac'
- '0'
- '1'
- '2'
- '3'
- '4'
- '5'
- '6'
- '7'
- '8'
- '9'
- '\xb3'
- '\xa9'
- '\x1a'
- '\x1a'
- '\xbb'
- '\x9f'
- )
- encoding_table=codecs.charmap_build(decoding_table)
|