Author: Matti Picus <[email protected]>
Branch: unicode-utf8-py3
Changeset: r94993:dacb894c61e0
Date: 2018-08-11 23:35 -0700
http://bitbucket.org/pypy/pypy/changeset/dacb894c61e0/
Log: change for utf8 not unicode
diff --git a/pypy/interpreter/unicodehelper.py
b/pypy/interpreter/unicodehelper.py
--- a/pypy/interpreter/unicodehelper.py
+++ b/pypy/interpreter/unicodehelper.py
@@ -263,13 +263,8 @@
msg = "ordinal not in range(256)"
res_8, newindex = errorhandler(
errors, 'latin1', msg, s, startindex, index)
- for cp in rutf8.Utf8StringIterator(res_8):
- if cp > 0xFF:
- errorhandler("strict", 'latin1', msg, s, startindex, index)
- result.append(chr(cp))
- if index != newindex: # Should be uncommon
- index = newindex
- pos = rutf8._pos_at_index(s, newindex)
+ result.append(res_8)
+ pos = rutf8._pos_at_index(s, newindex)
return result.build()
def utf8_encode_ascii(s, errors, errorhandler):
@@ -296,13 +291,8 @@
msg = "ordinal not in range(128)"
res_8, newindex = errorhandler(
errors, 'ascii', msg, s, startindex, index)
- for cp in rutf8.Utf8StringIterator(res_8):
- if cp > 0x7F:
- errorhandler("strict", 'ascii', msg, s, startindex, index)
- result.append(chr(cp))
- if index != newindex: # Should be uncommon
- index = newindex
- pos = rutf8._pos_at_index(s, newindex)
+ result.append(res_8)
+ pos = rutf8._pos_at_index(s, newindex)
return result.build()
if sys.platform == 'win32':
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit