We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
PyUnicode_AsUTF8
1 parent 2f8eefe commit 22e9fafCopy full SHA for 22e9faf
Doc/c-api/unicode.rst
@@ -1054,6 +1054,15 @@ These are the UTF-8 codec APIs:
1054
1055
As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size.
1056
1057
+ .. warning::
1058
+
1059
+ This function does not have any special behavior for
1060
+ `null characters <https://en.wikipedia.org/wiki/Null_character>`_ embedded within
1061
+ *unicode*. As a result, strings containing null characters will remain in the returned
1062
+ string, which some C functions might interpret as the end of the string, leading to
1063
+ truncation. If truncation is an issue, it is recommended to use :c:func:`PyUnicode_AsUTF8AndSize`
1064
+ instead.
1065
1066
.. versionadded:: 3.3
1067
1068
.. versionchanged:: 3.7
0 commit comments