Skip to content
7 changes: 7 additions & 0 deletions Doc/c-api/unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,13 @@ These are the UTF-8 codec APIs:

As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size.

.. note::

This function does not handle null bytes within the unicode object. As a result, the length of the
returned string (from ``strlen()``) could be smaller than the length of the
passed unicode object, if the string contained embedded null characters. When handling user input,
it is recommended to use :c:func:`PyUnicode_AsUTF8AndSize` instead.

.. versionadded:: 3.3

.. versionchanged:: 3.7
Expand Down
Loading