mirror of
https://github.com/python/cpython.git
synced 2025-08-20 00:32:12 +00:00
[3.13] gh-46236: Add docs for PyUnicode_GetDefaultEncoding() doc (GH-130335) (GH-130511)
* Clarify sys.getdefaultencoding() documentation
* Add missing documentation for PyUnicode_GetDefaultEncoding,
the C equivalent of sys.getdefaultencoding
(cherry picked from commit 9f25c1f012
)
Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
This commit is contained in:
parent
d71b167c5c
commit
3161f01760
3 changed files with 14 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue