[pypy-commit] pypy unicode-utf8-py3: allow surrogates in wcharpsize2utf8

mattip pypy.commits at gmail.com
Tue Feb 12 17:29:21 EST 2019


Author: Matti Picus <matti.picus at gmail.com>
Branch: unicode-utf8-py3
Changeset: r95988:6165ec8e5e76
Date: 2019-02-12 23:19 +0200
http://bitbucket.org/pypy/pypy/changeset/6165ec8e5e76/

Log:	allow surrogates in wcharpsize2utf8

diff --git a/rpython/rtyper/lltypesystem/rffi.py b/rpython/rtyper/lltypesystem/rffi.py
--- a/rpython/rtyper/lltypesystem/rffi.py
+++ b/rpython/rtyper/lltypesystem/rffi.py
@@ -1029,7 +1029,7 @@
 
     s = StringBuilder(size)
     for i in range(size):
-        rutf8.unichr_as_utf8_append(s, ord(w[i]))
+        rutf8.unichr_as_utf8_append(s, ord(w[i]), True)
     return s.build()
 
 def wcharp2utf8(w):


More information about the pypy-commit mailing list