Skip to content

Commit 131ecf5

Browse files
committed
pythongh-46236: Add missing document of PyUnicode_DecodeCodePageStateful
`PyUnicode_DecodeCodePageStateful` is in the limited C-API, and the document does not exist.
1 parent 2de048c commit 131ecf5

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Doc/c-api/unicode.rst

+7
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,13 @@ the user settings on the machine running the codec.
13241324
in *consumed*.
13251325
13261326
1327+
.. c:function:: PyObject* PyUnicode_DecodeCodePageStateful(int code_page, const char *str, \
1328+
Py_ssize_t size, const char *errors, Py_ssize_t *consumed)
1329+
1330+
Same as :c:func:`PyUnicode_DecodeMBCSStateful`, except that using the code page
1331+
specified by *code_page*. Use :c:macro:`!CP_ACP` code page to get the MBCS decoder.
1332+
1333+
13271334
.. c:function:: PyObject* PyUnicode_AsMBCSString(PyObject *unicode)
13281335
13291336
Encode a Unicode object using MBCS and return the result as Python bytes

Doc/data/refcounts.dat

+7
Original file line numberDiff line numberDiff line change
@@ -2636,6 +2636,13 @@ PyUnicode_DecodeMBCSStateful:Py_ssize_t:size::
26362636
PyUnicode_DecodeMBCSStateful:const char*:errors::
26372637
PyUnicode_DecodeMBCSStateful:Py_ssize_t*:consumed::
26382638

2639+
PyUnicode_DecodeCodePageStateful:PyObject*::+1:
2640+
PyUnicode_DecodeCodePageStateful:int:code_page::
2641+
PyUnicode_DecodeCodePageStateful:const char*:s::
2642+
PyUnicode_DecodeCodePageStateful:Py_ssize_t:size::
2643+
PyUnicode_DecodeCodePageStateful:const char*:errors::
2644+
PyUnicode_DecodeCodePageStateful:Py_ssize_t*:consumed::
2645+
26392646
PyUnicode_EncodeCodePage:PyObject*::+1:
26402647
PyUnicode_EncodeCodePage:int:code_page::
26412648
PyUnicode_EncodeCodePage:PyObject*:unicode:0:

0 commit comments

Comments
 (0)