mirror of https://github.com/python/cpython
Issue #19569: Suggested more appropriate replacements for deprecated Unicode
C API functions.
This commit is contained in:
commit
92b9a1f911
|
@ -679,8 +679,8 @@ Extension modules can continue using them, as they will not be removed in Python
|
||||||
string content has been filled before using any of the access macros such as
|
string content has been filled before using any of the access macros such as
|
||||||
:c:func:`PyUnicode_KIND`.
|
:c:func:`PyUnicode_KIND`.
|
||||||
|
|
||||||
Please migrate to using :c:func:`PyUnicode_FromKindAndData` or
|
Please migrate to using :c:func:`PyUnicode_FromKindAndData`,
|
||||||
:c:func:`PyUnicode_New`.
|
:c:func:`PyUnicode_FromWideChar` or :c:func:`PyUnicode_New`.
|
||||||
|
|
||||||
|
|
||||||
.. c:function:: Py_UNICODE* PyUnicode_AsUnicode(PyObject *unicode)
|
.. c:function:: Py_UNICODE* PyUnicode_AsUnicode(PyObject *unicode)
|
||||||
|
@ -694,7 +694,7 @@ Extension modules can continue using them, as they will not be removed in Python
|
||||||
used in most C functions.
|
used in most C functions.
|
||||||
|
|
||||||
Please migrate to using :c:func:`PyUnicode_AsUCS4`,
|
Please migrate to using :c:func:`PyUnicode_AsUCS4`,
|
||||||
:c:func:`PyUnicode_Substring`, :c:func:`PyUnicode_ReadChar` or similar new
|
:c:func:`PyUnicode_AsWideChar`, :c:func:`PyUnicode_ReadChar` or similar new
|
||||||
APIs.
|
APIs.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1091,7 +1091,8 @@ These are the UTF-8 codec APIs:
|
||||||
|
|
||||||
.. deprecated-removed:: 3.3 4.0
|
.. deprecated-removed:: 3.3 4.0
|
||||||
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
||||||
:c:func:`PyUnicode_AsUTF8String` or :c:func:`PyUnicode_AsUTF8AndSize`.
|
:c:func:`PyUnicode_AsUTF8String`, :c:func:`PyUnicode_AsUTF8AndSize` or
|
||||||
|
:c:func:`PyUnicode_AsEncodedString`.
|
||||||
|
|
||||||
|
|
||||||
UTF-32 Codecs
|
UTF-32 Codecs
|
||||||
|
@ -1164,7 +1165,7 @@ These are the UTF-32 codec APIs:
|
||||||
|
|
||||||
.. deprecated-removed:: 3.3 4.0
|
.. deprecated-removed:: 3.3 4.0
|
||||||
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
||||||
:c:func:`PyUnicode_AsUTF32String`.
|
:c:func:`PyUnicode_AsUTF32String` or :c:func:`PyUnicode_AsEncodedString`.
|
||||||
|
|
||||||
|
|
||||||
UTF-16 Codecs
|
UTF-16 Codecs
|
||||||
|
@ -1239,7 +1240,7 @@ These are the UTF-16 codec APIs:
|
||||||
|
|
||||||
.. deprecated-removed:: 3.3 4.0
|
.. deprecated-removed:: 3.3 4.0
|
||||||
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
||||||
:c:func:`PyUnicode_AsUTF16String`.
|
:c:func:`PyUnicode_AsUTF16String` or :c:func:`PyUnicode_AsEncodedString`.
|
||||||
|
|
||||||
|
|
||||||
UTF-7 Codecs
|
UTF-7 Codecs
|
||||||
|
@ -1276,9 +1277,8 @@ These are the UTF-7 codec APIs:
|
||||||
Python "utf-7" codec.
|
Python "utf-7" codec.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.3 4.0
|
.. deprecated-removed:: 3.3 4.0
|
||||||
Part of the old-style :c:type:`Py_UNICODE` API.
|
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
||||||
|
:c:func:`PyUnicode_AsEncodedString`.
|
||||||
.. XXX replace with what?
|
|
||||||
|
|
||||||
|
|
||||||
Unicode-Escape Codecs
|
Unicode-Escape Codecs
|
||||||
|
@ -1341,7 +1341,8 @@ These are the "Raw Unicode Escape" codec APIs:
|
||||||
|
|
||||||
.. deprecated-removed:: 3.3 4.0
|
.. deprecated-removed:: 3.3 4.0
|
||||||
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
||||||
:c:func:`PyUnicode_AsRawUnicodeEscapeString`.
|
:c:func:`PyUnicode_AsRawUnicodeEscapeString` or
|
||||||
|
:c:func:`PyUnicode_AsEncodedString`.
|
||||||
|
|
||||||
|
|
||||||
Latin-1 Codecs
|
Latin-1 Codecs
|
||||||
|
@ -1372,7 +1373,8 @@ ordinals and only these are accepted by the codecs during encoding.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.3 4.0
|
.. deprecated-removed:: 3.3 4.0
|
||||||
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
||||||
:c:func:`PyUnicode_AsLatin1String`.
|
:c:func:`PyUnicode_AsLatin1String` or
|
||||||
|
:c:func:`PyUnicode_AsEncodedString`.
|
||||||
|
|
||||||
|
|
||||||
ASCII Codecs
|
ASCII Codecs
|
||||||
|
@ -1403,7 +1405,8 @@ codes generate errors.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.3 4.0
|
.. deprecated-removed:: 3.3 4.0
|
||||||
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
||||||
:c:func:`PyUnicode_AsASCIIString`.
|
:c:func:`PyUnicode_AsASCIIString` or
|
||||||
|
:c:func:`PyUnicode_AsEncodedString`.
|
||||||
|
|
||||||
|
|
||||||
Character Map Codecs
|
Character Map Codecs
|
||||||
|
@ -1467,9 +1470,9 @@ The following codec API is special in that maps Unicode to Unicode.
|
||||||
:exc:`LookupError`) are left untouched and are copied as-is.
|
:exc:`LookupError`) are left untouched and are copied as-is.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.3 4.0
|
.. deprecated-removed:: 3.3 4.0
|
||||||
Part of the old-style :c:type:`Py_UNICODE` API.
|
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
||||||
|
:c:func:`PyUnicode_Translate`. or :ref:`generic codec based API
|
||||||
.. XXX replace with what?
|
<codec-registry>`
|
||||||
|
|
||||||
|
|
||||||
.. c:function:: PyObject* PyUnicode_EncodeCharmap(const Py_UNICODE *s, Py_ssize_t size, \
|
.. c:function:: PyObject* PyUnicode_EncodeCharmap(const Py_UNICODE *s, Py_ssize_t size, \
|
||||||
|
@ -1481,7 +1484,8 @@ The following codec API is special in that maps Unicode to Unicode.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.3 4.0
|
.. deprecated-removed:: 3.3 4.0
|
||||||
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
||||||
:c:func:`PyUnicode_AsCharmapString`.
|
:c:func:`PyUnicode_AsCharmapString` or
|
||||||
|
:c:func:`PyUnicode_AsEncodedString`.
|
||||||
|
|
||||||
|
|
||||||
MBCS codecs for Windows
|
MBCS codecs for Windows
|
||||||
|
@ -1531,7 +1535,8 @@ the user settings on the machine running the codec.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.3 4.0
|
.. deprecated-removed:: 3.3 4.0
|
||||||
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
|
||||||
:c:func:`PyUnicode_AsMBCSString` or :c:func:`PyUnicode_EncodeCodePage`.
|
:c:func:`PyUnicode_AsMBCSString`, :c:func:`PyUnicode_EncodeCodePage` or
|
||||||
|
:c:func:`PyUnicode_AsEncodedString`.
|
||||||
|
|
||||||
|
|
||||||
Methods & Slots
|
Methods & Slots
|
||||||
|
|
Loading…
Reference in New Issue