123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- """ Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py.
- Written by Marc-Andre Lemburg (mal@lemburg.com).
- (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
- (c) Copyright 2000 Guido van Rossum.
- """
- 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='ptcp154',
- encode=Codec().encode,
- decode=Codec().decode,
- incrementalencoder=IncrementalEncoder,
- incrementaldecoder=IncrementalDecoder,
- streamreader=StreamReader,
- streamwriter=StreamWriter,
- )
- decoding_table = (
- '\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'
- ' '
- '!'
- '"'
- '#'
- '$'
- '%'
- '&'
- "'"
- '('
- ')'
- '*'
- '+'
- ','
- '-'
- '.'
- '/'
- '0'
- '1'
- '2'
- '3'
- '4'
- '5'
- '6'
- '7'
- '8'
- '9'
- ':'
- ';'
- '<'
- '='
- '>'
- '?'
- '@'
- 'A'
- 'B'
- 'C'
- 'D'
- 'E'
- 'F'
- 'G'
- 'H'
- 'I'
- 'J'
- 'K'
- 'L'
- 'M'
- 'N'
- 'O'
- 'P'
- 'Q'
- 'R'
- 'S'
- 'T'
- 'U'
- 'V'
- 'W'
- 'X'
- 'Y'
- 'Z'
- '['
- '\\'
- ']'
- '^'
- '_'
- '`'
- 'a'
- 'b'
- 'c'
- 'd'
- 'e'
- 'f'
- 'g'
- 'h'
- 'i'
- 'j'
- 'k'
- 'l'
- 'm'
- 'n'
- 'o'
- 'p'
- 'q'
- 'r'
- 's'
- 't'
- 'u'
- 'v'
- 'w'
- 'x'
- 'y'
- 'z'
- '{'
- '|'
- '}'
- '~'
- '\x7f'
- '\u0496'
- '\u0492'
- '\u04ee'
- '\u0493'
- '\u201e'
- '\u2026'
- '\u04b6'
- '\u04ae'
- '\u04b2'
- '\u04af'
- '\u04a0'
- '\u04e2'
- '\u04a2'
- '\u049a'
- '\u04ba'
- '\u04b8'
- '\u0497'
- '\u2018'
- '\u2019'
- '\u201c'
- '\u201d'
- '\u2022'
- '\u2013'
- '\u2014'
- '\u04b3'
- '\u04b7'
- '\u04a1'
- '\u04e3'
- '\u04a3'
- '\u049b'
- '\u04bb'
- '\u04b9'
- '\xa0'
- '\u040e'
- '\u045e'
- '\u0408'
- '\u04e8'
- '\u0498'
- '\u04b0'
- '\xa7'
- '\u0401'
- '\xa9'
- '\u04d8'
- '\xab'
- '\xac'
- '\u04ef'
- '\xae'
- '\u049c'
- '\xb0'
- '\u04b1'
- '\u0406'
- '\u0456'
- '\u0499'
- '\u04e9'
- '\xb6'
- '\xb7'
- '\u0451'
- '\u2116'
- '\u04d9'
- '\xbb'
- '\u0458'
- '\u04aa'
- '\u04ab'
- '\u049d'
- '\u0410'
- '\u0411'
- '\u0412'
- '\u0413'
- '\u0414'
- '\u0415'
- '\u0416'
- '\u0417'
- '\u0418'
- '\u0419'
- '\u041a'
- '\u041b'
- '\u041c'
- '\u041d'
- '\u041e'
- '\u041f'
- '\u0420'
- '\u0421'
- '\u0422'
- '\u0423'
- '\u0424'
- '\u0425'
- '\u0426'
- '\u0427'
- '\u0428'
- '\u0429'
- '\u042a'
- '\u042b'
- '\u042c'
- '\u042d'
- '\u042e'
- '\u042f'
- '\u0430'
- '\u0431'
- '\u0432'
- '\u0433'
- '\u0434'
- '\u0435'
- '\u0436'
- '\u0437'
- '\u0438'
- '\u0439'
- '\u043a'
- '\u043b'
- '\u043c'
- '\u043d'
- '\u043e'
- '\u043f'
- '\u0440'
- '\u0441'
- '\u0442'
- '\u0443'
- '\u0444'
- '\u0445'
- '\u0446'
- '\u0447'
- '\u0448'
- '\u0449'
- '\u044a'
- '\u044b'
- '\u044c'
- '\u044d'
- '\u044e'
- '\u044f'
- )
- encoding_table=codecs.charmap_build(decoding_table)
|