Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v8plus / lib / python2.4 / encodings / tis_620.py
CommitLineData
920dae64
AT
1""" Python Character Mapping Codec for TIS-620.
2
3 According to
4 ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-11.TXT the
5 TIS-620 is the identical to ISO_8859-11 with the 0xA0 (no-break
6 space) mapping removed.
7
8"""#"
9
10import codecs
11from encodings.iso8859_11 import decoding_map
12
13### Codec APIs
14
15class Codec(codecs.Codec):
16
17 def encode(self,input,errors='strict'):
18
19 return codecs.charmap_encode(input,errors,encoding_map)
20
21 def decode(self,input,errors='strict'):
22
23 return codecs.charmap_decode(input,errors,decoding_map)
24
25class StreamWriter(Codec,codecs.StreamWriter):
26 pass
27
28class StreamReader(Codec,codecs.StreamReader):
29 pass
30
31### encodings module API
32
33def getregentry():
34
35 return (Codec().encode,Codec().decode,StreamReader,StreamWriter)
36
37### Decoding Map
38
39decoding_map = decoding_map.copy()
40decoding_map.update({
41 0x00a0: None,
42})
43
44### Encoding Map
45
46encoding_map = codecs.make_encoding_map(decoding_map)