mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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:
parent
9987d9351c
commit
f2ea71fcc8
5 changed files with 177 additions and 37 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue