1. Alex Prengère
  2. pypy

Source

pypy / pypy / module / _multibytecodec / c_codecs.py

Diff from to

File pypy/module/_multibytecodec/c_codecs.py

             replace = "?"
     else:
         assert errorcb
-        replace, end = errorcb(errors, namecb, reason,
-                               unicodedata, start, end)
+        ret, end = errorcb(errors, namecb, reason,
+                           unicodedata, start, end)
+        codec = pypy_cjk_enc_getcodec(encodebuf)
+        replace = encode(codec, ret, "strict", errorcb, namecb)
     inbuf = rffi.get_nonmovingbuffer(replace)
     try:
         r = pypy_cjk_enc_replace_on_error(encodebuf, inbuf, len(replace), end)