PyXR

c:\python24\lib \ encodings \ tis_620.py



0001 """ Python Character Mapping Codec for TIS-620.
0002 
0003     According to
0004     ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-11.TXT the
0005     TIS-620 is the identical to ISO_8859-11 with the 0xA0 (no-break
0006     space) mapping removed.
0007 
0008 """#"
0009 
0010 import codecs
0011 from encodings.iso8859_11 import decoding_map
0012 
0013 ### Codec APIs
0014 
0015 class Codec(codecs.Codec):
0016 
0017     def encode(self,input,errors='strict'):
0018 
0019         return codecs.charmap_encode(input,errors,encoding_map)
0020 
0021     def decode(self,input,errors='strict'):
0022 
0023         return codecs.charmap_decode(input,errors,decoding_map)
0024 
0025 class StreamWriter(Codec,codecs.StreamWriter):
0026     pass
0027 
0028 class StreamReader(Codec,codecs.StreamReader):
0029     pass
0030 
0031 ### encodings module API
0032 
0033 def getregentry():
0034 
0035     return (Codec().encode,Codec().decode,StreamReader,StreamWriter)
0036 
0037 ### Decoding Map
0038 
0039 decoding_map = decoding_map.copy()
0040 decoding_map.update({
0041         0x00a0: None,
0042 })
0043 
0044 ### Encoding Map
0045 
0046 encoding_map = codecs.make_encoding_map(decoding_map)
0047 

Generated by PyXR 0.9.4
SourceForge.net Logo