This patch adds a new builtin unistr() which behaves like str()

except that it always returns Unicode objects.

A new C API PyObject_Unicode() is also provided.

This closes patch #101664.

Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
This commit is contained in:
Marc-André Lemburg 2001-01-17 17:09:53 +00:00
parent d5c43065d5
commit ad7c98e264
10 changed files with 119 additions and 6 deletions

View file

@ -413,6 +413,7 @@ PyObject *PyUnicode_FromEncodedObject(register PyObject *obj,
}
else
v = PyUnicode_Decode(s, len, encoding, errors);
done:
if (owned) {
Py_DECREF(obj);