diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-03-17 22:08:06 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-03-17 22:08:06 (GMT) |
commit | 7d00cc1a6432b5f2338172ceba388d336e466d2e (patch) | |
tree | cde3b6ca56e2bd0f6c2c892c99a8129a7f763e9e /Lib/encodings | |
parent | c49926748b36d639c3c6889ffcb90ab069bba8ae (diff) | |
download | cpython-7d00cc1a6432b5f2338172ceba388d336e466d2e.zip cpython-7d00cc1a6432b5f2338172ceba388d336e466d2e.tar.gz cpython-7d00cc1a6432b5f2338172ceba388d336e466d2e.tar.bz2 |
Issue #20574: Implement incremental decoder for cp65001 code
(Windows code page 65001, Microsoft UTF-8).
Diffstat (limited to 'Lib/encodings')
-rw-r--r-- | Lib/encodings/cp65001.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/encodings/cp65001.py b/Lib/encodings/cp65001.py index 287eb87..95cb2ae 100644 --- a/Lib/encodings/cp65001.py +++ b/Lib/encodings/cp65001.py @@ -11,20 +11,23 @@ if not hasattr(codecs, 'code_page_encode'): ### Codec APIs encode = functools.partial(codecs.code_page_encode, 65001) -decode = functools.partial(codecs.code_page_decode, 65001) +_decode = functools.partial(codecs.code_page_decode, 65001) + +def decode(input, errors='strict'): + return codecs.code_page_decode(65001, input, errors, True) class IncrementalEncoder(codecs.IncrementalEncoder): def encode(self, input, final=False): return encode(input, self.errors)[0] class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - _buffer_decode = decode + _buffer_decode = _decode class StreamWriter(codecs.StreamWriter): encode = encode class StreamReader(codecs.StreamReader): - decode = decode + decode = _decode ### encodings module API |