PyUnicode_FromObject

Coerce obj to an Unicode object and return a reference with _*incremented* refcount.

Unicode objects are passed back as-is (subclasses are converted to true Unicode objects), all other objects are delegated to PyUnicode_FromEncodedObject(obj, NULL, "strict") which results in using the default encoding as basis for decoding the object.

The API returns NULL in case of an error. The caller is responsible for decref'ing the returned objects.

  1. PyObject* PyUnicode_FromObject(PyObject* obj)
    version(Python_3_3_Or_Later)
    extern (C)
    PyUnicode_FromObject
  2. alias PyUnicode_FromObject = PyUnicodeUCS2_FromObject
  3. alias PyUnicode_FromObject = PyUnicodeUCS4_FromObject

Meta