summaryrefslogtreecommitdiffstats
path: root/Include/unicodeobject.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-10-18 19:21:00 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-10-18 19:21:00 (GMT)
commit3a50e7056ebfb835785c84df925d79bde6d0d209 (patch)
tree6a6f61d276043fc53dc3290cd74ed7aab3506eab /Include/unicodeobject.h
parent1e73a2467f312f7b5ebef515cca6d3a16cf36f97 (diff)
downloadcpython-3a50e7056ebfb835785c84df925d79bde6d0d209.zip
cpython-3a50e7056ebfb835785c84df925d79bde6d0d209.tar.gz
cpython-3a50e7056ebfb835785c84df925d79bde6d0d209.tar.bz2
Issue #12281: Rewrite the MBCS codec to handle correctly replace and ignore
error handlers on all Windows versions. The MBCS codec is now supporting all error handlers, instead of only replace to encode and ignore to decode.
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r--Include/unicodeobject.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index a1725e5..99ec44c 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -1466,6 +1466,14 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCSStateful(
Py_ssize_t *consumed /* bytes consumed */
);
+PyAPI_FUNC(PyObject*) PyUnicode_DecodeCodePageStateful(
+ int code_page, /* code page number */
+ const char *string, /* encoded string */
+ Py_ssize_t length, /* size of string */
+ const char *errors, /* error handling */
+ Py_ssize_t *consumed /* bytes consumed */
+ );
+
PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString(
PyObject *unicode /* Unicode object */
);
@@ -1473,11 +1481,17 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString(
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS(
const Py_UNICODE *data, /* Unicode char buffer */
- Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
+ Py_ssize_t length, /* number of Py_UNICODE chars to encode */
const char *errors /* error handling */
);
#endif
+PyAPI_FUNC(PyObject*) PyUnicode_EncodeCodePage(
+ int code_page, /* code page number */
+ PyObject *unicode, /* Unicode object */
+ const char *errors /* error handling */
+ );
+
#endif /* HAVE_MBCS */
/* --- Decimal Encoder ---------------------------------------------------- */