8000 gh-113437: Update documentation about PyUnicode_AsWideChar() function… · python/cpython@5719aa2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5719aa2

Browse files
authored
gh-113437: Update documentation about PyUnicode_AsWideChar() function (GH-113455)
1 parent f9f6156 commit 5719aa2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Doc/c-api/unicode.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,12 @@ wchar_t Support
854854
Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. At most
855855
*size* :c:type:`wchar_t` characters are copied (excluding a possibly trailing
856856
null termination character). Return the number of :c:type:`wchar_t` characters
857-
copied or ``-1`` in case of an error. Note that the resulting :c:expr:`wchar_t*`
857+
copied or ``-1`` in case of an error.
858+
859+
When *wstr* is ``NULL``, instead return the *size* that would be required
860+
to store all of *unicode* including a terminating null.
861+
862+
Note that the resulting :c:expr:`wchar_t*`
858863
string may or may not be null-terminated. It is the responsibility of the caller
859864
to make sure that the :c:expr:`wchar_t*` string is null-terminated in case this is
860865
required by the application. Also, note that the :c:expr:`wchar_t*` string

0 commit comments

Comments
 (0)
0