summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2000-07-07 13:46:42 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2000-07-07 13:46:42 (GMT)
commit5a5c81a0e9550eaab92c9817259dee5a52f69871 (patch)
treeaab9c45dc4f627f3f89c99beae1dac470ae9cb6d /Include
parentb6d78fcd9c3fae5caa82b55f426aa82ed76f9429 (diff)
downloadcpython-5a5c81a0e9550eaab92c9817259dee5a52f69871.zip
cpython-5a5c81a0e9550eaab92c9817259dee5a52f69871.tar.gz
cpython-5a5c81a0e9550eaab92c9817259dee5a52f69871.tar.bz2
Added new API PyUnicode_FromEncodedObject() which supports decoding
objects including instance objects. The old API PyUnicode_FromObject() is still available as shortcut.
Diffstat (limited to 'Include')
-rw-r--r--Include/unicodeobject.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index b9840dd..38f787b 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -297,6 +297,24 @@ extern DL_IMPORT(int) PyUnicode_Resize(
*/
+extern DL_IMPORT(PyObject*) PyUnicode_FromEncodedObject(
+ register PyObject *obj, /* Object */
+ const char *encoding, /* encoding */
+ const char *errors /* error handling */
+ );
+
+/* Shortcut for PyUnicode_FromEncodedObject(obj, NULL, "strict");
+ which results in using the default encoding as basis for
+ decoding the object.
+
+ Coerces obj to an Unicode object and return a reference with
+ *incremented* refcount.
+
+ The API returns NULL in case of an error. The caller is responsible
+ for decref'ing the returned objects.
+
+*/
+
extern DL_IMPORT(PyObject*) PyUnicode_FromObject(
register PyObject *obj /* Object */
);