Skip to content

Commit 958bb1c

Browse files
authored
Merge branch '3.12' into backport-61b9811-3.12
2 parents 2246cfa + e6cb31a commit 958bb1c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Doc/c-api/unicode.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,15 @@ These are the UTF-8 codec APIs:
10321032
10331033
As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size.
10341034
1035+
.. warning::
1036+
1037+
This function does not have any special behavior for
1038+
`null characters <https://en.wikipedia.org/wiki/Null_character>`_ embedded within
1039+
*unicode*. As a result, strings containing null characters will remain in the returned
1040+
string, which some C functions might interpret as the end of the string, leading to
1041+
truncation. If truncation is an issue, it is recommended to use :c:func:`PyUnicode_AsUTF8AndSize`
1042+
instead.
1043+
10351044
.. versionadded:: 3.3
10361045
10371046
.. versionchanged:: 3.7

0 commit comments

Comments
 (0)