PyUnicodeUCS2_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.

version(!Python_3_3_Or_Later && Python_Unicode_UCS2)
extern (C)
PyUnicodeUCS2_FromEncodedObject
(,
const(char)* encoding
,
const(char)* errors
)

Meta