Issue #13560: Locale codec functions use the classic "errors" parameter,
instead of surrogateescape
So it would be possible to support more error handlers later.
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 8a23c7d..c5480f1 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -1608,14 +1608,14 @@
PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocaleAndSize(
const char *str,
Py_ssize_t len,
- int surrogateescape);
+ const char *errors);
/* Similar to PyUnicode_DecodeLocaleAndSize(), but compute the string
length using strlen(). */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocale(
const char *str,
- int surrogateescape);
+ const char *errors);
/* Encode a Unicode object to the current locale encoding. The encoder is
strict is *surrogateescape* is equal to zero, otherwise the
@@ -1624,7 +1624,7 @@
PyAPI_FUNC(PyObject*) PyUnicode_EncodeLocale(
PyObject *unicode,
- int surrogateescape
+ const char *errors
);
/* --- File system encoding ---------------------------------------------- */