1 """ Python 'utf-7' Codec
3 Written by Brian Quinlan (brian@sweetapp.com).
9 encode
= codecs
.utf_7_encode
11 def decode(input, errors
='strict'):
12 return codecs
.utf_7_decode(input, errors
, True)
14 class IncrementalEncoder(codecs
.IncrementalEncoder
):
15 def encode(self
, input, final
=False):
16 return codecs
.utf_7_encode(input, self
.errors
)[0]
18 class IncrementalDecoder(codecs
.BufferedIncrementalDecoder
):
19 _buffer_decode
= codecs
.utf_7_decode
21 class StreamWriter(codecs
.StreamWriter
):
22 encode
= codecs
.utf_7_encode
24 class StreamReader(codecs
.StreamReader
):
25 decode
= codecs
.utf_7_decode
27 ### encodings module API
30 return codecs
.CodecInfo(
34 incrementalencoder
=IncrementalEncoder
,
35 incrementaldecoder
=IncrementalDecoder
,
36 streamreader
=StreamReader
,
37 streamwriter
=StreamWriter
,