WIN32: Simplify string conversion

This commit is contained in:
Cameron Cawley 2020-09-06 16:56:13 +01:00 committed by Eugene Sandulenko
parent 6e0c93dc46
commit da978f3a2f
4 changed files with 6 additions and 32 deletions

View file

@ -105,16 +105,4 @@ char *unicodeToAnsi(const wchar_t *s, uint codePage) {
return NULL;
}
wchar_t *UTF8ToUnicode(const char *s) {
DWORD size = MultiByteToWideChar(CP_UTF8, 0, s, -1, NULL, 0);
if (size > 0) {
LPWSTR result = (LPWSTR)calloc(size, sizeof(WCHAR));
if (MultiByteToWideChar(CP_UTF8, 0, s, -1, result, size) != 0)
return result;
}
return NULL;
}
}