mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
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:
parent
d5c43065d5
commit
ad7c98e264
10 changed files with 119 additions and 6 deletions
|
@ -413,6 +413,7 @@ PyObject *PyUnicode_FromEncodedObject(register PyObject *obj,
|
|||
}
|
||||
else
|
||||
v = PyUnicode_Decode(s, len, encoding, errors);
|
||||
|
||||
done:
|
||||
if (owned) {
|
||||
Py_DECREF(obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue