Replace ConvertFromUnicode and ConvertToUnicode

* Use new ConvertUtf8ToWChar, ConvertUtf8NToWChar,
  ConvertUtf8ToWCharAlloc and ConvertUtf8NToWCharAlloc
* Use new ConvertWCharToUtf8, ConvertWCharNToUtf8,
  ConvertWCharToUtf8Alloc and ConvertWCharNToUtf8Alloc
* Use new Stream UTF16 to/from UTF8 read/write functions
* Use new settings UTF16 to/from UTF8 read/write functions
This commit is contained in:
akallabeth
2022-10-28 08:09:27 +02:00
committed by akallabeth
parent 2aefa9418d
commit 5799fb2018
85 changed files with 1228 additions and 1357 deletions

View File

@@ -148,8 +148,10 @@ error_out:
static HANDLE FindFirstFileUTF8(LPCSTR pszSearchPath, WIN32_FIND_DATAW* FindData)
{
HANDLE hdl = INVALID_HANDLE_VALUE;
WCHAR* wpath = NULL;
if (ConvertToUnicode(CP_UTF8, 0, pszSearchPath, -1, &wpath, 0) <= 0)
if (!pszSearchPath)
return hdl;
WCHAR* wpath = ConvertUtf8ToWCharAlloc(pszSearchPath, NULL);
if (!wpath)
return hdl;
hdl = FindFirstFileW(wpath, FindData);
@@ -254,7 +256,9 @@ static FREERDP_ADDIN** freerdp_channels_list_dynamic_addins(LPCSTR pszName, LPCS
goto error_out;
}
if (ConvertFromUnicode(CP_UTF8, 0, FindData.cFileName, -1, &cFileName, 0, NULL, NULL) <= 0)
cFileName =
ConvertWCharNToUtf8Alloc(FindData.cFileName, ARRAYSIZE(FindData.cFileName), NULL);
if (!cFileName)
goto skip;
nDashes = 0;