From: Victor Stinner Date: Fri, 3 Jan 2014 12:16:00 +0000 (+0100) Subject: unicode_char() uses get_latin1_char() to get latin1 singleton characters X-Git-Tag: v3.4.0b2~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3b46b4a66560945d4c80ac2f10764e3d7f71f8d;p=python unicode_char() uses get_latin1_char() to get latin1 singleton characters --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 1fb5742317..b2279a652d 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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;