Function gpa::utility::UTF8ToUnicode

Function Documentation

int gpa::utility::UTF8ToUnicode(char const *utf8, wchar_t *unicode, size_t unicodeLen)

UTF8ToUnicode - convert from Unicode string to UTF8 string.

Parameters
  • utf8 -- NULL-terminated UTF8 string

  • unicode -- Buffer to recieve UTF8 string converted to Unicode

  • unicodeLen -- Length of unicode

Returns

Number of wide characters actually converted(excluding the terminating '\0'). If UTF8 string would convert to Unicode string longer than unicodeLen, unicode will receive a version of utf8 truncated to unicodeLen-1 bytes. If conversion was not possible for any reason, this function returns -1.