From a38bacd41f2bf91f640a2885cc3892864d210b44 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:36:06 +0100 Subject: [PATCH] [3.13] gh-46236: Document `PyUnicode_DecodeCodePageStateful` (GH-127934) (GH-129961) gh-46236: Document `PyUnicode_DecodeCodePageStateful` (GH-127934) (cherry picked from commit 8d9d3e4ecb4c908df6560b54138dd5af73b3ed47) Co-authored-by: Yuki Kobayashi Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Peter Bierma --- Doc/c-api/unicode.rst | 7 +++++++ Doc/data/refcounts.dat | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 22e134c9f08..64c16056ece 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -1352,6 +1352,13 @@ the user settings on the machine running the codec. in *consumed*. +.. c:function:: PyObject* PyUnicode_DecodeCodePageStateful(int code_page, const char *str, \ + Py_ssize_t size, const char *errors, Py_ssize_t *consumed) + + Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page + specified by *code_page*. + + .. c:function:: PyObject* PyUnicode_AsMBCSString(PyObject *unicode) Encode a Unicode object using MBCS and return the result as Python bytes diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat index 99f4d59b558..ae6c9f71ba9 100644 --- a/Doc/data/refcounts.dat +++ b/Doc/data/refcounts.dat @@ -2622,6 +2622,13 @@ PyUnicode_DecodeMBCSStateful:Py_ssize_t:size:: PyUnicode_DecodeMBCSStateful:const char*:errors:: PyUnicode_DecodeMBCSStateful:Py_ssize_t*:consumed:: +PyUnicode_DecodeCodePageStateful:PyObject*::+1: +PyUnicode_DecodeCodePageStateful:int:code_page:: +PyUnicode_DecodeCodePageStateful:const char*:s:: +PyUnicode_DecodeCodePageStateful:Py_ssize_t:size:: +PyUnicode_DecodeCodePageStateful:const char*:errors:: +PyUnicode_DecodeCodePageStateful:Py_ssize_t*:consumed:: + PyUnicode_EncodeCodePage:PyObject*::+1: PyUnicode_EncodeCodePage:int:code_page:: PyUnicode_EncodeCodePage:PyObject*:unicode:0: