PyUnicode_FromEncodedObject

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

Coercion is done in the following way:

1. String and other char buffer compatible objects are decoded under the assumptions that they contain data using the current default encoding. Decoding is done in "strict" mode.

2. All other objects (including Unicode objects) raise an exception.

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

  1. PyObject* PyUnicode_FromEncodedObject(PyObject* obj, const(char)* encoding, const(char)* errors)
  2. alias PyUnicode_FromEncodedObject = PyUnicodeUCS2_FromEncodedObject
    version(!Python_3_3_Or_Later && Python_Unicode_UCS2)
    extern (C)
    alias PyUnicode_FromEncodedObject = PyUnicodeUCS2_FromEncodedObject
  3. alias PyUnicode_FromEncodedObject = PyUnicodeUCS4_FromEncodedObject

Meta