diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/main.c | 2 | ||||
-rw-r--r-- | Modules/posixmodule.c | 2 | ||||
-rw-r--r-- | Modules/timemodule.c | 9 |
3 files changed, 7 insertions, 6 deletions
diff --git a/Modules/main.c b/Modules/main.c index 4899378..d8c5172 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -495,7 +495,7 @@ Py_Main(int argc, wchar_t **argv) /* Use utf-8 on Mac OS X */ unicode = PyUnicode_FromString(p); #else - unicode = PyUnicode_DecodeLocale(p, 1); + unicode = PyUnicode_DecodeLocale(p, "surrogateescape"); #endif if (unicode == NULL) { /* ignore errors */ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 6b832c0..acdc00c 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -7891,7 +7891,7 @@ posix_strerror(PyObject *self, PyObject *args) "strerror() argument out of range"); return NULL; } - return PyUnicode_DecodeLocale(message, 1); + return PyUnicode_DecodeLocale(message, "surrogateescape"); } diff --git a/Modules/timemodule.c b/Modules/timemodule.c index ad1c54e..ad28e58 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -486,7 +486,7 @@ time_strftime(PyObject *self, PyObject *args) fmt = format; #else /* Convert the unicode string to an ascii one */ - format = PyUnicode_EncodeLocale(format_arg, 1); + format = PyUnicode_EncodeLocale(format_arg, "surrogateescape"); if (format == NULL) return NULL; fmt = PyBytes_AS_STRING(format); @@ -532,7 +532,8 @@ time_strftime(PyObject *self, PyObject *args) #ifdef HAVE_WCSFTIME ret = PyUnicode_FromWideChar(outbuf, buflen); #else - ret = PyUnicode_DecodeLocaleAndSize(outbuf, buflen, 1); + ret = PyUnicode_DecodeLocaleAndSize(outbuf, buflen, + "surrogateescape"); #endif PyMem_Free(outbuf); break; @@ -764,8 +765,8 @@ PyInit_timezone(PyObject *m) { #endif /* PYOS_OS2 */ #endif PyModule_AddIntConstant(m, "daylight", daylight); - otz0 = PyUnicode_DecodeLocale(tzname[0], 1); - otz1 = PyUnicode_DecodeLocale(tzname[1], 1); + otz0 = PyUnicode_DecodeLocale(tzname[0], "surrogateescape"); + otz1 = PyUnicode_DecodeLocale(tzname[1], "surrogateescape"); PyModule_AddObject(m, "tzname", Py_BuildValue("(NN)", otz0, otz1)); #else /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/ #ifdef HAVE_STRUCT_TM_TM_ZONE |