Function gpa::utility::UnicodeToUTF8

Function Documentation

int gpa::utility::UnicodeToUTF8(wchar_t const *unicode, char *utf8, size_t utf8len)

UnicodeToUTF8 - convert from Unicode string to UTF8 string.

Parameters
  • unicode -- NULL-terminated Unicode string

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

  • utf8len -- Length of utf8

Returns

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