diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index e751bc4334d..b876f342fd7 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1959,7 +1959,7 @@ int PyUnicode_EncodeDecimal(Py_UNICODE *s, continue; } if (0 < ch < 256) { - *output++ = ch; + *output++ = (char) ch; continue; } /* All other characters are considered invalid */