Propagate exceptions from shutdown() if raiseExceptions is not set.
[python.git] / Lib / encodings / gb2312.py
blob5130efa1ab87f62a21494b31dd1bd3880d8c4de4
2 # gb2312.py: Python Unicode Codec for GB2312
4 # Written by Hye-Shik Chang <perky@FreeBSD.org>
5 # $CJKCodecs: gb2312.py,v 1.8 2004/06/28 18:16:03 perky Exp $
8 import _codecs_cn, codecs
10 codec = _codecs_cn.getcodec('gb2312')
12 class Codec(codecs.Codec):
13 encode = codec.encode
14 decode = codec.decode
16 class StreamReader(Codec, codecs.StreamReader):
17 def __init__(self, stream, errors='strict'):
18 codecs.StreamReader.__init__(self, stream, errors)
19 __codec = codec.StreamReader(stream, errors)
20 self.read = __codec.read
21 self.readline = __codec.readline
22 self.readlines = __codec.readlines
23 self.reset = __codec.reset
25 class StreamWriter(Codec, codecs.StreamWriter):
26 def __init__(self, stream, errors='strict'):
27 codecs.StreamWriter.__init__(self, stream, errors)
28 __codec = codec.StreamWriter(stream, errors)
29 self.write = __codec.write
30 self.writelines = __codec.writelines
31 self.reset = __codec.reset
33 def getregentry():
34 return (codec.encode, codec.decode, StreamReader, StreamWriter)