diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-27 18:05:49 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-27 18:05:49 (GMT) |
commit | 0093907f0ed88c6aa3561cc4328154ae907bc976 (patch) | |
tree | f1a2f717936afa914240619aef371f6232979e77 /Include/unicodeobject.h | |
parent | 802426f99b93e8338c0c3fc6df0b97eb6b211a3e (diff) | |
download | cpython-0093907f0ed88c6aa3561cc4328154ae907bc976.zip cpython-0093907f0ed88c6aa3561cc4328154ae907bc976.tar.gz cpython-0093907f0ed88c6aa3561cc4328154ae907bc976.tar.bz2 |
Issue #28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(),
PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and
PyUnicode_AsEncodedUnicode().
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r-- | Include/unicodeobject.h | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 643d10d..5711de0 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -1171,22 +1171,30 @@ PyAPI_FUNC(PyObject*) PyUnicode_Decode( ); /* Decode a Unicode object unicode and return the result as Python - object. */ + object. + + This API is DEPRECATED. The only supported standard encoding is rot13. + Use PyCodec_Decode() to decode with rot13 and non-standard codecs + that decode from str. */ PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedObject( PyObject *unicode, /* Unicode object */ const char *encoding, /* encoding */ const char *errors /* error handling */ - ); + ) Py_DEPRECATED(3.6); /* Decode a Unicode object unicode and return the result as Unicode - object. */ + object. + + This API is DEPRECATED. The only supported standard encoding is rot13. + Use PyCodec_Decode() to decode with rot13 and non-standard codecs + that decode from str to str. */ PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedUnicode( PyObject *unicode, /* Unicode object */ const char *encoding, /* encoding */ const char *errors /* error handling */ - ); + ) Py_DEPRECATED(3.6); /* Encodes a Py_UNICODE buffer of the given size and returns a Python string object. */ @@ -1201,13 +1209,18 @@ PyAPI_FUNC(PyObject*) PyUnicode_Encode( #endif /* Encodes a Unicode object and returns the result as Python - object. */ + object. + + This API is DEPRECATED. It is superceeded by PyUnicode_AsEncodedString() + since all standard encodings (except rot13) encode str to bytes. + Use PyCodec_Encode() for encoding with rot13 and non-standard codecs + that encode form str to non-bytes. */ PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedObject( PyObject *unicode, /* Unicode object */ const char *encoding, /* encoding */ const char *errors /* error handling */ - ); + ) Py_DEPRECATED(3.6); /* Encodes a Unicode object and returns the result as Python string object. */ @@ -1219,13 +1232,17 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedString( ); /* Encodes a Unicode object and returns the result as Unicode - object. */ + object. + + This API is DEPRECATED. The only supported standard encodings is rot13. + Use PyCodec_Encode() to encode with rot13 and non-standard codecs + that encode from str to str. */ PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedUnicode( PyObject *unicode, /* Unicode object */ const char *encoding, /* encoding */ const char *errors /* error handling */ - ); + ) Py_DEPRECATED(3.6); /* Build an encoding map. */ |