Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Doc/c-api/unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,15 @@ APIs:
decref'ing the returned objects.


.. c:function:: const char* PyUnicode_GetDefaultEncoding(void)

Return the name of the default string encoding, ``"utf-8"``.
See :func:`sys.getdefaultencoding`.

The returned string does not need to be freed, and is valid
until interpreter shutdown.


.. c:function:: Py_ssize_t PyUnicode_GetLength(PyObject *unicode)

Return the length of the Unicode object, in code points.
Expand Down
3 changes: 3 additions & 0 deletions Doc/data/refcounts.dat
Original file line number Diff line number Diff line change
Expand Up @@ -2770,6 +2770,9 @@ PyUnicode_FromFormatV:PyObject*::+1:
PyUnicode_FromFormatV:const char*:format::
PyUnicode_FromFormatV:va_list:args::

PyUnicode_GetDefaultEncoding:const char*:::
PyUnicode_GetDefaultEncoding::void::

PyUnicode_GetLength:Py_ssize_t:::
PyUnicode_GetLength:PyObject*:unicode:0:

Expand Down
4 changes: 2 additions & 2 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,8 @@ always available. Unless explicitly noted otherwise, all variables are read-only

.. function:: getdefaultencoding()

Return the name of the current default string encoding used by the Unicode
implementation.
Return ``'utf-8'``. This is the name of the default string encoding, used
in methods like :meth:`str.encode`.


.. function:: getdlopenflags()
Expand Down
Loading