Issue #13560: Add PyUnicode_EncodeLocale()

* Use PyUnicode_EncodeLocale() in time.strftime() if wcsftime() is not
   available
 * Document my last changes in Misc/NEWS
This commit is contained in:
Victor Stinner 2011-12-17 04:13:41 +01:00
parent 9987d9351c
commit f2ea71fcc8
5 changed files with 177 additions and 37 deletions

View file

@ -486,7 +486,7 @@ time_strftime(PyObject *self, PyObject *args)
fmt = format;
#else
/* Convert the unicode string to an ascii one */
format = PyUnicode_EncodeFSDefault(format_arg);
format = PyUnicode_EncodeLocale(format_arg, 1);
if (format == NULL)
return NULL;
fmt = PyBytes_AS_STRING(format);