Author: Matti Picus <matti.pi...@gmail.com> Branch: Changeset: r96042:d13ae7d283ae Date: 2019-02-17 16:53 +0200 http://bitbucket.org/pypy/pypy/changeset/d13ae7d283ae/
Log: revert part of 4e661aec658f to keep synced with py3.6 diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -21,7 +21,7 @@ space.newtext(msg)])) return raise_unicode_exception_decode -def decode_never_raise(errors, encoding, msg, s, startingpos, endingpos): +def _decode_never_raise(errors, encoding, msg, s, startingpos, endingpos): assert startingpos >= 0 ux = ['\ux' + hex(ord(x))[2:].upper() for x in s[startingpos:endingpos]] return ''.join(ux), endingpos, 'b' @@ -918,6 +918,13 @@ return result.build() +def decode_utf8sp(space, string): + # Surrogate-preserving utf-8 decoding. Assuming there is no + # encoding error, it should always be reversible, and the reverse is + # encode_utf8sp(). + return str_decode_utf8(string, "string", True, _decode_never_raise, + allow_surrogates=True) + # ____________________________________________________________ # utf-16 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit