123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- """ 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_map)
- def decode(self,input,errors='strict'):
- return codecs.charmap_decode(input,errors,decoding_map)
- class IncrementalEncoder(codecs.IncrementalEncoder):
- def encode(self, input, final=False):
- return codecs.charmap_encode(input,self.errors,encoding_map)[0]
- class IncrementalDecoder(codecs.IncrementalDecoder):
- def decode(self, input, final=False):
- return codecs.charmap_decode(input,self.errors,decoding_map)[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_map = codecs.make_identity_dict(range(256))
- decoding_map.update({
- 0x0080: 0x0496,
- 0x0081: 0x0492,
- 0x0082: 0x04ee,
- 0x0083: 0x0493,
- 0x0084: 0x201e,
- 0x0085: 0x2026,
- 0x0086: 0x04b6,
- 0x0087: 0x04ae,
- 0x0088: 0x04b2,
- 0x0089: 0x04af,
- 0x008a: 0x04a0,
- 0x008b: 0x04e2,
- 0x008c: 0x04a2,
- 0x008d: 0x049a,
- 0x008e: 0x04ba,
- 0x008f: 0x04b8,
- 0x0090: 0x0497,
- 0x0091: 0x2018,
- 0x0092: 0x2019,
- 0x0093: 0x201c,
- 0x0094: 0x201d,
- 0x0095: 0x2022,
- 0x0096: 0x2013,
- 0x0097: 0x2014,
- 0x0098: 0x04b3,
- 0x0099: 0x04b7,
- 0x009a: 0x04a1,
- 0x009b: 0x04e3,
- 0x009c: 0x04a3,
- 0x009d: 0x049b,
- 0x009e: 0x04bb,
- 0x009f: 0x04b9,
- 0x00a1: 0x040e,
- 0x00a2: 0x045e,
- 0x00a3: 0x0408,
- 0x00a4: 0x04e8,
- 0x00a5: 0x0498,
- 0x00a6: 0x04b0,
- 0x00a8: 0x0401,
- 0x00aa: 0x04d8,
- 0x00ad: 0x04ef,
- 0x00af: 0x049c,
- 0x00b1: 0x04b1,
- 0x00b2: 0x0406,
- 0x00b3: 0x0456,
- 0x00b4: 0x0499,
- 0x00b5: 0x04e9,
- 0x00b8: 0x0451,
- 0x00b9: 0x2116,
- 0x00ba: 0x04d9,
- 0x00bc: 0x0458,
- 0x00bd: 0x04aa,
- 0x00be: 0x04ab,
- 0x00bf: 0x049d,
- 0x00c0: 0x0410,
- 0x00c1: 0x0411,
- 0x00c2: 0x0412,
- 0x00c3: 0x0413,
- 0x00c4: 0x0414,
- 0x00c5: 0x0415,
- 0x00c6: 0x0416,
- 0x00c7: 0x0417,
- 0x00c8: 0x0418,
- 0x00c9: 0x0419,
- 0x00ca: 0x041a,
- 0x00cb: 0x041b,
- 0x00cc: 0x041c,
- 0x00cd: 0x041d,
- 0x00ce: 0x041e,
- 0x00cf: 0x041f,
- 0x00d0: 0x0420,
- 0x00d1: 0x0421,
- 0x00d2: 0x0422,
- 0x00d3: 0x0423,
- 0x00d4: 0x0424,
- 0x00d5: 0x0425,
- 0x00d6: 0x0426,
- 0x00d7: 0x0427,
- 0x00d8: 0x0428,
- 0x00d9: 0x0429,
- 0x00da: 0x042a,
- 0x00db: 0x042b,
- 0x00dc: 0x042c,
- 0x00dd: 0x042d,
- 0x00de: 0x042e,
- 0x00df: 0x042f,
- 0x00e0: 0x0430,
- 0x00e1: 0x0431,
- 0x00e2: 0x0432,
- 0x00e3: 0x0433,
- 0x00e4: 0x0434,
- 0x00e5: 0x0435,
- 0x00e6: 0x0436,
- 0x00e7: 0x0437,
- 0x00e8: 0x0438,
- 0x00e9: 0x0439,
- 0x00ea: 0x043a,
- 0x00eb: 0x043b,
- 0x00ec: 0x043c,
- 0x00ed: 0x043d,
- 0x00ee: 0x043e,
- 0x00ef: 0x043f,
- 0x00f0: 0x0440,
- 0x00f1: 0x0441,
- 0x00f2: 0x0442,
- 0x00f3: 0x0443,
- 0x00f4: 0x0444,
- 0x00f5: 0x0445,
- 0x00f6: 0x0446,
- 0x00f7: 0x0447,
- 0x00f8: 0x0448,
- 0x00f9: 0x0449,
- 0x00fa: 0x044a,
- 0x00fb: 0x044b,
- 0x00fc: 0x044c,
- 0x00fd: 0x044d,
- 0x00fe: 0x044e,
- 0x00ff: 0x044f,
- })
- encoding_map = codecs.make_encoding_map(decoding_map)
|