We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
PyUnicode_AsUTF8
1 parent 032058c commit e6cb31aCopy full SHA for e6cb31a
Doc/c-api/unicode.rst
@@ -1032,6 +1032,15 @@ These are the UTF-8 codec APIs:
1032
1033
As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size.
1034
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
1044
.. versionadded:: 3.3
1045
1046
.. versionchanged:: 3.7
0 commit comments