summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-02-14 10:24:40 (GMT)
committerGitHub <noreply@github.com>2024-02-14 10:24:40 (GMT)
commit03d2c3b8041adc1b60f20bc86ae28e5f659b48bf (patch)
treeaa42f952325d84a6c0605e1a07016332c535dce9 /Doc/c-api
parent9c7307520d3b4d86803e69ddebd7d6d534b87605 (diff)
downloadcpython-03d2c3b8041adc1b60f20bc86ae28e5f659b48bf.zip
cpython-03d2c3b8041adc1b60f20bc86ae28e5f659b48bf.tar.gz
cpython-03d2c3b8041adc1b60f20bc86ae28e5f659b48bf.tar.bz2
[3.12] gh-113437: Update documentation about PyUnicode_AsWideChar() function (GH-113455) (GH-115407)
(cherry picked from commit 5719aa23ab7f1c7a5f03309ca4044078a98e7b59) Co-authored-by: qqwqqw689 <114795525+qqwqqw689@users.noreply.github.com>
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/unicode.rst7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 302316a..54a006c 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -861,7 +861,12 @@ wchar_t Support
Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. At most
*size* :c:type:`wchar_t` characters are copied (excluding a possibly trailing
null termination character). Return the number of :c:type:`wchar_t` characters
- copied or ``-1`` in case of an error. Note that the resulting :c:expr:`wchar_t*`
+ copied or ``-1`` in case of an error.
+
+ When *wstr* is ``NULL``, instead return the *size* that would be required
+ to store all of *unicode* including a terminating null.
+
+ Note that the resulting :c:expr:`wchar_t*`
string may or may not be null-terminated. It is the responsibility of the caller
to make sure that the :c:expr:`wchar_t*` string is null-terminated in case this is
required by the application. Also, note that the :c:expr:`wchar_t*` string