summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/unicode.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/c-api/unicode.rst')
-rw-r--r--Doc/c-api/unicode.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 4b89f49..4533279 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -335,6 +335,14 @@ APIs:
buffer, *NULL* if *unicode* is not a Unicode object.
+.. cfunction:: Py_UNICODE* PyUnicode_AsUnicodeCopy(PyObject *unicode)
+
+ Create a copy of a unicode string ending with a nul character. Return *NULL*
+ and raise a :exc:`MemoryError` exception on memory allocation failure,
+ otherwise return a new allocated buffer (use :cfunc:`PyMem_Free` to free the
+ buffer).
+
+
.. cfunction:: Py_ssize_t PyUnicode_GetSize(PyObject *unicode)
Return the length of the Unicode object.