unicode_char() uses get_latin1_char() to get latin1 singleton characters

This commit is contained in:
Victor Stinner 2014-01-03 13:16:00 +01:00
parent 985a82a6d2
commit f3b46b4a66
1 changed files with 3 additions and 0 deletions

View File

@ -1772,6 +1772,9 @@ unicode_char(Py_UCS4 ch)
assert(ch <= MAX_UNICODE);
if (ch < 256)
return get_latin1_char(ch);
unicode = PyUnicode_New(1, ch);
if (unicode == NULL)
return NULL;