Skip to content

Commit 03d2c3b

Browse files
[3.12] gh-113437: Update documentation about PyUnicode_AsWideChar() function (GH-113455) (GH-115407)
(cherry picked from commit 5719aa2) Co-authored-by: qqwqqw689 <114795525+qqwqqw689@users.noreply.github.com>
1 parent 9c73075 commit 03d2c3b

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
@@ -861,7 +861,12 @@ wchar_t Support
861861
Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. At most
862862
*size* :c:type:`wchar_t` characters are copied (excluding a possibly trailing
863863
null termination character). Return the number of :c:type:`wchar_t` characters
864-
copied or ``-1`` in case of an error. Note that the resulting :c:expr:`wchar_t*`
864+
copied or ``-1`` in case of an error.
865+
866+
When *wstr* is ``NULL``, instead return the *size* that would be required
867+
to store all of *unicode* including a terminating null.
868+
869+
Note that the resulting :c:expr:`wchar_t*`
865870
string may or may not be null-terminated. It is the responsibility of the caller
866871
to make sure that the :c:expr:`wchar_t*` string is null-terminated in case this is
867872
required by the application. Also, note that the :c:expr:`wchar_t*` string

0 commit comments

Comments
 (0)