diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-12-08 23:18:11 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-12-08 23:18:11 (GMT) |
commit | b6821013df384b9c858bbef1ead86641ad88e54c (patch) | |
tree | 9fc0e0bff7a2b7851c44693fea9d15d283207c6f /Doc/c-api | |
parent | d1be878d7b59ab48157b75b52d2684ba09731e59 (diff) | |
download | cpython-b6821013df384b9c858bbef1ead86641ad88e54c.zip cpython-b6821013df384b9c858bbef1ead86641ad88e54c.tar.gz cpython-b6821013df384b9c858bbef1ead86641ad88e54c.tar.bz2 |
Document PyUnicode_Copy() and PyUnicode_EncodeCodePage()
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/unicode.rst | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index d87ce0d..65d4af5 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -386,6 +386,13 @@ APIs: .. versionadded:: 3.3 +.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode) + + Get a new copy of a Unicode object. + + .. versionadded:: 3.3 + + .. c:function:: PyObject* PyUnicode_FromKindAndData(int kind, const void *buffer, \ Py_ssize_t size) @@ -1379,6 +1386,15 @@ the user settings on the machine running the codec. raised by the codec. +.. c:function:: PyObject* PyUnicode_EncodeCodePage(int code_page, PyObject *unicode, const char *errors) + + Encode the Unicode object using the specified code page and return a Python + bytes object. Return *NULL* if an exception was raised by the codec. Use + :c:data:`CP_ACP` code page to get the MBCS encoder. + + .. versionadded:: 3.3 + + .. c:function:: PyObject* PyUnicode_EncodeMBCS(const Py_UNICODE *s, Py_ssize_t size, const char *errors) Encode the :c:type:`Py_UNICODE` buffer of the given *size* using MBCS and return @@ -1387,7 +1403,7 @@ the user settings on the machine running the codec. .. deprecated-removed:: 3.3 4.0 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsMBCSString`. + :c:func:`PyUnicode_AsMBCSString` or :c:func:`PyUnicode_EncodeCodePage`. Methods & Slots |