diff options
author | Inada Naoki <songofacandy@gmail.com> | 2021-05-07 06:58:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-07 06:58:29 (GMT) |
commit | 9ad8f109ac037ac088e09dcd2da523322c5caf34 (patch) | |
tree | d125df68405fd1e98f3edf67d9e3c52b679688f5 /Doc/c-api/unicode.rst | |
parent | 4ebf4a6bfad4afcbab3baf9c0159c7767e2a64c0 (diff) | |
download | cpython-9ad8f109ac037ac088e09dcd2da523322c5caf34.zip cpython-9ad8f109ac037ac088e09dcd2da523322c5caf34.tar.gz cpython-9ad8f109ac037ac088e09dcd2da523322c5caf34.tar.bz2 |
bpo-44029: Remove Py_UNICODE APIs (GH-25881)
Remove deprecated `Py_UNICODE` APIs: `PyUnicode_Encode`,
`PyUnicode_EncodeUTF7`, `PyUnicode_EncodeUTF8`,
`PyUnicode_EncodeUTF16`, `PyUnicode_EncodeUTF32`,
`PyUnicode_EncodeLatin1`, `PyUnicode_EncodeMBCS`,
`PyUnicode_EncodeDecimal`, `PyUnicode_EncodeRawUnicodeEscape`,
`PyUnicode_EncodeCharmap`, `PyUnicode_EncodeUnicodeEscape`,
`PyUnicode_TransformDecimalToASCII`, `PyUnicode_TranslateCharmap`,
`PyUnicodeEncodeError_Create`, `PyUnicodeTranslateError_Create`.
See :pep:`393` and :pep:`624` for reference.
Diffstat (limited to 'Doc/c-api/unicode.rst')
-rw-r--r-- | Doc/c-api/unicode.rst | 185 |
1 files changed, 0 insertions, 185 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 8d4eef8..8322d3d 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -719,17 +719,6 @@ Extension modules can continue using them, as they will not be removed in Python :c:func:`PyUnicode_ReadChar` or similar new APIs. -.. c:function:: PyObject* PyUnicode_TransformDecimalToASCII(Py_UNICODE *s, Py_ssize_t size) - - Create a Unicode object by replacing all decimal digits in - :c:type:`Py_UNICODE` buffer of the given *size* by ASCII digits 0--9 - according to their decimal value. Return ``NULL`` if an exception occurs. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`Py_UNICODE_TODECIMAL`. - - .. c:function:: Py_UNICODE* PyUnicode_AsUnicodeAndSize(PyObject *unicode, Py_ssize_t *size) Like :c:func:`PyUnicode_AsUnicode`, but also saves the :c:func:`Py_UNICODE` @@ -1038,20 +1027,6 @@ These are the generic codec APIs: the codec. -.. c:function:: PyObject* PyUnicode_Encode(const Py_UNICODE *s, Py_ssize_t size, \ - const char *encoding, const char *errors) - - Encode the :c:type:`Py_UNICODE` buffer *s* of the given *size* and return a Python - bytes object. *encoding* and *errors* have the same meaning as the - parameters of the same name in the Unicode :meth:`~str.encode` method. The codec - to be used is looked up using the Python codec registry. Return ``NULL`` if an - exception was raised by the codec. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsEncodedString`. - - UTF-8 Codecs """""""""""" @@ -1114,18 +1089,6 @@ These are the UTF-8 codec APIs: The return type is now ``const char *`` rather of ``char *``. -.. c:function:: PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - - Encode the :c:type:`Py_UNICODE` buffer *s* of the given *size* using UTF-8 and - return a Python bytes object. Return ``NULL`` if an exception was raised by - the codec. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsUTF8String`, :c:func:`PyUnicode_AsUTF8AndSize` or - :c:func:`PyUnicode_AsEncodedString`. - - UTF-32 Codecs """"""""""""" @@ -1176,29 +1139,6 @@ These are the UTF-32 codec APIs: Return ``NULL`` if an exception was raised by the codec. -.. c:function:: PyObject* PyUnicode_EncodeUTF32(const Py_UNICODE *s, Py_ssize_t size, \ - const char *errors, int byteorder) - - Return a Python bytes object holding the UTF-32 encoded value of the Unicode - data in *s*. Output is written according to the following byte order:: - - byteorder == -1: little endian - byteorder == 0: native byte order (writes a BOM mark) - byteorder == 1: big endian - - If byteorder is ``0``, the output string will always start with the Unicode BOM - mark (U+FEFF). In the other two modes, no BOM mark is prepended. - - If ``Py_UNICODE_WIDE`` is not defined, surrogate pairs will be output - as a single code point. - - Return ``NULL`` if an exception was raised by the codec. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsUTF32String` or :c:func:`PyUnicode_AsEncodedString`. - - UTF-16 Codecs """"""""""""" @@ -1250,30 +1190,6 @@ These are the UTF-16 codec APIs: Return ``NULL`` if an exception was raised by the codec. -.. c:function:: PyObject* PyUnicode_EncodeUTF16(const Py_UNICODE *s, Py_ssize_t size, \ - const char *errors, int byteorder) - - Return a Python bytes object holding the UTF-16 encoded value of the Unicode - data in *s*. Output is written according to the following byte order:: - - byteorder == -1: little endian - byteorder == 0: native byte order (writes a BOM mark) - byteorder == 1: big endian - - If byteorder is ``0``, the output string will always start with the Unicode BOM - mark (U+FEFF). In the other two modes, no BOM mark is prepended. - - If ``Py_UNICODE_WIDE`` is defined, a single :c:type:`Py_UNICODE` value may get - represented as a surrogate pair. If it is not defined, each :c:type:`Py_UNICODE` - values is interpreted as a UCS-2 character. - - Return ``NULL`` if an exception was raised by the codec. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsUTF16String` or :c:func:`PyUnicode_AsEncodedString`. - - UTF-7 Codecs """""""""""" @@ -1295,23 +1211,6 @@ These are the UTF-7 codec APIs: bytes that have been decoded will be stored in *consumed*. -.. c:function:: PyObject* PyUnicode_EncodeUTF7(const Py_UNICODE *s, Py_ssize_t size, \ - int base64SetO, int base64WhiteSpace, const char *errors) - - Encode the :c:type:`Py_UNICODE` buffer of the given size using UTF-7 and - return a Python bytes object. Return ``NULL`` if an exception was raised by - the codec. - - If *base64SetO* is nonzero, "Set O" (punctuation that has no otherwise - special meaning) will be encoded in base-64. If *base64WhiteSpace* is - nonzero, whitespace will be encoded in base-64. Both are set to zero for the - Python "utf-7" codec. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsEncodedString`. - - Unicode-Escape Codecs """"""""""""""""""""" @@ -1332,16 +1231,6 @@ These are the "Unicode Escape" codec APIs: raised by the codec. -.. c:function:: PyObject* PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size) - - Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Unicode-Escape and - return a bytes object. Return ``NULL`` if an exception was raised by the codec. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsUnicodeEscapeString`. - - Raw-Unicode-Escape Codecs """"""""""""""""""""""""" @@ -1362,18 +1251,6 @@ These are the "Raw Unicode Escape" codec APIs: was raised by the codec. -.. c:function:: PyObject* PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, \ - Py_ssize_t size) - - Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Raw-Unicode-Escape - and return a bytes object. Return ``NULL`` if an exception was raised by the codec. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsRawUnicodeEscapeString` or - :c:func:`PyUnicode_AsEncodedString`. - - Latin-1 Codecs """""""""""""" @@ -1394,18 +1271,6 @@ ordinals and only these are accepted by the codecs during encoding. raised by the codec. -.. c:function:: PyObject* PyUnicode_EncodeLatin1(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - - Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Latin-1 and - return a Python bytes object. Return ``NULL`` if an exception was raised by - the codec. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsLatin1String` or - :c:func:`PyUnicode_AsEncodedString`. - - ASCII Codecs """""""""""" @@ -1426,18 +1291,6 @@ codes generate errors. raised by the codec. -.. c:function:: PyObject* PyUnicode_EncodeASCII(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - - Encode the :c:type:`Py_UNICODE` buffer of the given *size* using ASCII and - return a Python bytes object. Return ``NULL`` if an exception was raised by - the codec. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsASCIIString` or - :c:func:`PyUnicode_AsEncodedString`. - - Character Map Codecs """""""""""""""""""" @@ -1477,19 +1330,6 @@ These are the mapping codec APIs: ``None`` are treated as "undefined mapping" and cause an error. -.. c:function:: PyObject* PyUnicode_EncodeCharmap(const Py_UNICODE *s, Py_ssize_t size, \ - PyObject *mapping, const char *errors) - - Encode the :c:type:`Py_UNICODE` buffer of the given *size* using the given - *mapping* object and return the result as a bytes object. Return ``NULL`` if - an exception was raised by the codec. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsCharmapString` or - :c:func:`PyUnicode_AsEncodedString`. - - The following codec API is special in that maps Unicode to Unicode. .. c:function:: PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors) @@ -1509,19 +1349,6 @@ The following codec API is special in that maps Unicode to Unicode. use the default error handling. -.. c:function:: PyObject* PyUnicode_TranslateCharmap(const Py_UNICODE *s, Py_ssize_t size, \ - PyObject *mapping, const char *errors) - - Translate a :c:type:`Py_UNICODE` buffer of the given *size* by applying a - character *mapping* table to it and return the resulting Unicode object. - Return ``NULL`` when an exception was raised by the codec. - - .. deprecated-removed:: 3.3 3.11 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_Translate`. or :ref:`generic codec based API - <codec-registry>` - - MBCS codecs for Windows """"""""""""""""""""""" @@ -1561,18 +1388,6 @@ the user settings on the machine running the codec. .. versionadded:: 3.3 -.. c:function:: PyObject* PyUnicode_EncodeMBCS(const Py_UNICODE *s, Py_ssize_t size, const char *errors) - - Encode the :c:type:`Py_UNICODE` buffer of the given *size* using MBCS and return - a Python bytes object. Return ``NULL`` if an exception was raised by the - codec. - - .. deprecated-removed:: 3.3 4.0 - Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using - :c:func:`PyUnicode_AsMBCSString`, :c:func:`PyUnicode_EncodeCodePage` or - :c:func:`PyUnicode_AsEncodedString`. - - Methods & Slots """"""""""""""" |