From 7ffbd62ceb8e7847347b5d6f551d094d5d2e4174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laci=20b=C3=A1?= Date: Fri, 19 Nov 2021 21:33:21 +0100 Subject: [PATCH] Fix encoding issues in win_progsett.c and win_icon.c --- src/win/win_icon.c | 2 +- src/win/win_progsett.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/win/win_icon.c b/src/win/win_icon.c index e5e4cdc67..9b0d5ef23 100644 --- a/src/win/win_icon.c +++ b/src/win/win_icon.c @@ -135,7 +135,7 @@ void win_load_icon_set() for (i = 0; i < count; i++) { plat_append_filename(temp, path_root, icon_files[i].filename); - mbstowcs(wtemp, temp, strlen(temp) + 1); + mbstoc16s(wtemp, temp, strlen(temp) + 1); HICON ictemp; ictemp = LoadImageW(NULL, (LPWSTR)wtemp, IMAGE_ICON, x, y, LR_LOADFROMFILE | LR_DEFAULTCOLOR); diff --git a/src/win/win_progsett.c b/src/win/win_progsett.c index 46ede599b..2617cdd44 100644 --- a/src/win/win_progsett.c +++ b/src/win/win_progsett.c @@ -102,7 +102,7 @@ progsett_fill_iconsets(HWND hdlg) win_get_icons_path(icon_path_root); wchar_t search[512]; - mbstowcs(search, icon_path_root, strlen(icon_path_root) + 1); + mbstoc16s(search, icon_path_root, strlen(icon_path_root) + 1); wcscat(search, L"*.*"); hFind = FindFirstFile((LPCWSTR)search, &data); @@ -113,7 +113,7 @@ progsett_fill_iconsets(HWND hdlg) (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { wchar_t temp[512] = {0}, dispname[512] = {0}; - mbstowcs(temp, icon_path_root, strlen(icon_path_root) + 1); + mbstoc16s(temp, icon_path_root, strlen(icon_path_root) + 1); wcscat(temp, data.cFileName); wcscat(temp, L"\\iconinfo.txt"); @@ -124,14 +124,14 @@ progsett_fill_iconsets(HWND hdlg) char line[512] = {0}; if (fgets(line, 511, fp)) { - mbstowcs(dispname, line, strlen(line) + 1); + mbstoc16s(dispname, line, strlen(line) + 1); } fclose(fp); } char filename[512]; - wcstombs(filename, data.cFileName, 511); + c16stombs(filename, data.cFileName, 511); int index = SendMessage(icon_combo, CB_ADDSTRING, 0, (LPARAM)dispname); SendMessage(icon_combo, CB_SETITEMDATA, index, (LPARAM)(strdup(filename)));