Lines Matching refs:codecs
9 import codecs, sys
13 encode = codecs.utf_16_encode
16 return codecs.utf_16_decode(input, errors, True)
18 class IncrementalEncoder(codecs.IncrementalEncoder):
20 codecs.IncrementalEncoder.__init__(self, errors)
25 result = codecs.utf_16_encode(input, self.errors)[0]
27 self.encoder = codecs.utf_16_le_encode
29 self.encoder = codecs.utf_16_be_encode
34 codecs.IncrementalEncoder.reset(self)
49 self.encoder = codecs.utf_16_le_encode
51 self.encoder = codecs.utf_16_be_encode
53 class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
55 codecs.BufferedIncrementalDecoder.__init__(self, errors)
61 codecs.utf_16_ex_decode(input, errors, 0, final)
63 self.decoder = codecs.utf_16_le_decode
65 self.decoder = codecs.utf_16_be_decode
72 codecs.BufferedIncrementalDecoder.reset(self)
78 state = codecs.BufferedIncrementalDecoder.getstate(self)[0]
86 (self.decoder is codecs.utf_16_be_decode))
91 codecs.BufferedIncrementalDecoder.setstate(self, state)
94 self.decoder = (codecs.utf_16_be_decode
96 else codecs.utf_16_le_decode)
98 self.decoder = (codecs.utf_16_le_decode
100 else codecs.utf_16_be_decode)
104 class StreamWriter(codecs.StreamWriter):
106 codecs.StreamWriter.__init__(self, stream, errors)
110 codecs.StreamWriter.reset(self)
115 result = codecs.utf_16_encode(input, errors)
117 self.encoder = codecs.utf_16_le_encode
119 self.encoder = codecs.utf_16_be_encode
124 class StreamReader(codecs.StreamReader):
127 codecs.StreamReader.reset(self)
135 codecs.utf_16_ex_decode(input, errors, 0, False)
137 self.decode = codecs.utf_16_le_decode
139 self.decode = codecs.utf_16_be_decode
147 return codecs.CodecInfo(