diff options
Diffstat (limited to 'Lib/encodings/latin_1.py')
-rw-r--r-- | Lib/encodings/latin_1.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Lib/encodings/latin_1.py b/Lib/encodings/latin_1.py index 0e55917..370160c 100644 --- a/Lib/encodings/latin_1.py +++ b/Lib/encodings/latin_1.py @@ -17,6 +17,14 @@ class Codec(codecs.Codec): encode = codecs.latin_1_encode decode = codecs.latin_1_decode +class IncrementalEncoder(codecs.IncrementalEncoder): + def encode(self, input, final=False): + return codecs.latin_1_encode(input,self.errors)[0] + +class IncrementalDecoder(codecs.IncrementalDecoder): + def decode(self, input, final=False): + return codecs.latin_1_decode(input,self.errors)[0] + class StreamWriter(Codec,codecs.StreamWriter): pass @@ -31,5 +39,12 @@ class StreamConverter(StreamWriter,StreamReader): ### encodings module API def getregentry(): - - return (Codec.encode,Codec.decode,StreamReader,StreamWriter) + return codecs.CodecInfo( + name='iso8859-1', + encode=Codec.encode, + decode=Codec.decode, + incrementalencoder=IncrementalEncoder, + incrementaldecoder=IncrementalDecoder, + streamreader=StreamReader, + streamwriter=StreamWriter, + ) |