Skip to content

Commit 7f88cb1

Browse files
[3.11] gh-113437: Update documentation about PyUnicode_AsWideChar() function (GH-113455) (GH-115408)
(cherry picked from commit 5719aa2) Co-authored-by: qqwqqw689 <114795525+qqwqqw689@users.noreply.github.com>
1 parent b587379 commit 7f88cb1

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
@@ -950,7 +950,12 @@ wchar_t Support
950950
Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. At most
951951
*size* :c:type:`wchar_t` characters are copied (excluding a possibly trailing
952952
null termination character). Return the number of :c:type:`wchar_t` characters
953-
copied or ``-1`` in case of an error. Note that the resulting :c:expr:`wchar_t*`
953+
copied or ``-1`` in case of an error.
954+
955+
When *wstr* is ``NULL``, instead return the *size* that would be required
956+
to store all of *unicode* including a terminating null.
957+
958+
Note that the resulting :c:expr:`wchar_t*`
954959
string may or may not be null-terminated. It is the responsibility of the caller
955960
to make sure that the :c:expr:`wchar_t*` string is null-terminated in case this is
956961
required by the application. Also, note that the :c:expr:`wchar_t*` string

0 commit comments

Comments
 (0)