summaryrefslogtreecommitdiff
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2018-01-11 10:37:59 +0100
committerGitHub <noreply@github.com>2018-01-11 10:37:59 +0100
commitcb3ae5588bd7733e76dc09277bb7626652d9bb64 (patch)
tree137a100f35284a1327a8ec38052433aa21e13281 /Objects/unicodeobject.c
parent3948207c610e931831828d33aaef258185df31db (diff)
downloadcpython-git-cb3ae5588bd7733e76dc09277bb7626652d9bb64.tar.gz
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.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 1a230e03e6..a6e02f478b 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -3837,6 +3837,12 @@ _PyUnicode_DecodeCurrentLocaleAndSize(const char *str, Py_ssize_t len,
}
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);