mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
bpo-29240: Ignore UTF-8 Mode in time module (#5148)
time.strftime() must use the current LC_CTYPE encoding, not UTF-8 if the UTF-8 mode is enabled. Add _PyUnicode_DecodeCurrentLocale() function.
This commit is contained in:
parent
3948207c61
commit
cb3ae5588b
4 changed files with 17 additions and 8 deletions
|
|
@ -138,8 +138,7 @@ encode(PyObject *b)
|
|||
static PyObject *
|
||||
decode(const char *s)
|
||||
{
|
||||
return _PyUnicode_DecodeCurrentLocaleAndSize(s, strlen(s),
|
||||
"surrogateescape");
|
||||
return _PyUnicode_DecodeCurrentLocale(s, "surrogateescape");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue