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.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 1a230e0..a6e02f4 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -3837,6 +3837,12 @@
}
PyObject*
+_PyUnicode_DecodeCurrentLocale(const char *str, const char *errors)
+{
+ return unicode_decode_locale(str, (Py_ssize_t)strlen(str), errors, 1);
+}
+
+PyObject*
PyUnicode_DecodeLocale(const char *str, const char *errors)
{
Py_ssize_t size = (Py_ssize_t)strlen(str);