diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-09-29 10:25:54 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-09-29 10:25:54 (GMT) |
commit | 137c34c0274954b2cdd1fd5b490c654528ff30f7 (patch) | |
tree | ec540a9b6bba9617af8afcb099fd4908a5bac230 /Doc/c-api | |
parent | 41a64a53a30f2d81de7b4a05e5e8e9b4089f7ca7 (diff) | |
download | cpython-137c34c0274954b2cdd1fd5b490c654528ff30f7.zip cpython-137c34c0274954b2cdd1fd5b490c654528ff30f7.tar.gz cpython-137c34c0274954b2cdd1fd5b490c654528ff30f7.tar.bz2 |
Issue #9979: Create function PyUnicode_AsWideCharString().
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/unicode.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 2e274ad..50a1254 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -462,6 +462,19 @@ wchar_t support for platforms which support it: required by the application. +.. cfunction:: wchar_t* PyUnicode_AsWideCharString(PyUnicodeObject *unicode, Py_ssize_t *size) + + Convert the Unicode object to a wide character string. The output string + always ends with a nul character. If *size* is not *NULL*, write the number + of wide characters (including the nul character) into *\*size*. + + Returns a buffer allocated by :cfunc:`PyMem_Alloc` (use :cfunc:`PyMem_Free` + to free it) on success. On error, returns *NULL*, *\*size* is undefined and + raises a :exc:`MemoryError`. + + .. versionadded:: 3.2 + + .. _builtincodecs: Built-in Codecs |