diff options
author | Marc-André Lemburg <mal@egenix.com> | 2004-07-08 17:57:32 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2004-07-08 17:57:32 (GMT) |
commit | d2d4598ec2e33e73efcbf295e630296b24a1b70b (patch) | |
tree | 75a03f4df07b3c998bfcbb334f051b5f4ada371c /Include/unicodeobject.h | |
parent | 302fa6dc0d90f3e5aac66347458c69713ae7581d (diff) | |
download | cpython-d2d4598ec2e33e73efcbf295e630296b24a1b70b.zip cpython-d2d4598ec2e33e73efcbf295e630296b24a1b70b.tar.gz cpython-d2d4598ec2e33e73efcbf295e630296b24a1b70b.tar.bz2 |
Allow string and unicode return types from .encode()/.decode()
methods on string and unicode objects. Added unicode.decode()
which was missing for no apparent reason.
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r-- | Include/unicodeobject.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 345dacf..45118b3 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -141,6 +141,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE; # define PyUnicode_AsASCIIString PyUnicodeUCS2_AsASCIIString # define PyUnicode_AsCharmapString PyUnicodeUCS2_AsCharmapString +# define PyUnicode_AsEncodedObject PyUnicodeUCS2_AsEncodedObject # define PyUnicode_AsEncodedString PyUnicodeUCS2_AsEncodedString # define PyUnicode_AsLatin1String PyUnicodeUCS2_AsLatin1String # define PyUnicode_AsRawUnicodeEscapeString PyUnicodeUCS2_AsRawUnicodeEscapeString @@ -215,6 +216,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE; # define PyUnicode_AsASCIIString PyUnicodeUCS4_AsASCIIString # define PyUnicode_AsCharmapString PyUnicodeUCS4_AsCharmapString +# define PyUnicode_AsEncodedObject PyUnicodeUCS4_AsEncodedObject # define PyUnicode_AsEncodedString PyUnicodeUCS4_AsEncodedString # define PyUnicode_AsLatin1String PyUnicodeUCS4_AsLatin1String # define PyUnicode_AsRawUnicodeEscapeString PyUnicodeUCS4_AsRawUnicodeEscapeString @@ -626,6 +628,15 @@ PyAPI_FUNC(PyObject*) PyUnicode_Encode( const char *errors /* error handling */ ); +/* Encodes a Unicode object and returns the result as Python + object. */ + +PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedObject( + PyObject *unicode, /* Unicode object */ + const char *encoding, /* encoding */ + const char *errors /* error handling */ + ); + /* Encodes a Unicode object and returns the result as Python string object. */ |