PyUnicode_AsWideChar

Copies the Unicode Object contents into the wchar_t buffer w. At most size wchar_t characters are copied.

Note that the resulting wchar_t string may or may not be 0-terminated. It is the responsibility of the caller to make sure that the wchar_t string is 0-terminated in case this is required by the application.

Returns the number of wchar_t characters copied (excluding a possibly trailing 0-termination character) or -1 in case of an error.

  1. Py_ssize_t PyUnicode_AsWideChar(PyUnicodeObject* unicode, const(wchar)* w, Py_ssize_t size)
  2. alias PyUnicode_AsWideChar = PyUnicodeUCS2_AsWideChar
    version(!Python_3_3_Or_Later && Python_Unicode_UCS2)
    extern (C)
    alias PyUnicode_AsWideChar = PyUnicodeUCS2_AsWideChar
  3. alias PyUnicode_AsWideChar = PyUnicodeUCS4_AsWideChar

Meta