diff --git a/Source/Project64/AppInit.cpp b/Source/Project64/AppInit.cpp index 9937de1c9..9bf1c4d3c 100644 --- a/Source/Project64/AppInit.cpp +++ b/Source/Project64/AppInit.cpp @@ -2,7 +2,6 @@ #include void FixDirectories(void); -void FixLocale(void); static void IncreaseThreadPriority(void); @@ -47,7 +46,6 @@ void AppInit(CNotification * Notify) g_Notify = Notify; FixDirectories(); - FixLocale(); stdstr_f AppName("Project64 %s", VER_FILE_VERSION_STR); IncreaseThreadPriority(); @@ -122,18 +120,7 @@ void FixDirectories(void) if (!Directory.DirectoryExists()) Directory.DirectoryCreate(); } -#include -void FixLocale(void) -{ - char *lbuffer = new char[10]; - if (GetLocaleInfoA(LOCALE_SYSTEM_DEFAULT, LOCALE_SABBREVLANGNAME, lbuffer, 10)) - { - setlocale(LC_ALL, lbuffer); - } - delete[] lbuffer; -} - void IncreaseThreadPriority(void) { SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); -} \ No newline at end of file +} diff --git a/Source/Project64/User Interface/Main Menu Class.cpp b/Source/Project64/User Interface/Main Menu Class.cpp index a4655b341..d9e1d3c7b 100644 --- a/Source/Project64/User Interface/Main Menu Class.cpp +++ b/Source/Project64/User Interface/Main Menu Class.cpp @@ -734,10 +734,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu) } stdstr_f MenuString("&%d %s", (count + 1) % 10, LastRom.c_str()); - WCHAR *w_LastRom = new WCHAR[MenuString.length() + 1]; - ::mbstowcs(w_LastRom, MenuString.c_str(), MenuString.length() + 1); - RecentRomMenu.push_back(MENU_ITEM(ID_RECENT_ROM_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, w_LastRom)); - delete[] w_LastRom; + RecentRomMenu.push_back(MENU_ITEM(ID_RECENT_ROM_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, MenuString.ToUTF16(CP_ACP).c_str())); } /* Recent Dir @@ -755,10 +752,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu) stdstr_f MenuString("&%d %s", (count + 1) % 10, LastDir.c_str()); - WCHAR *w_LastDir = new WCHAR[MenuString.length() + 1]; - ::mbstowcs(w_LastDir, MenuString.c_str(), MenuString.length() + 1); - RecentDirMenu.push_back(MENU_ITEM(ID_RECENT_DIR_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, w_LastDir)); - delete[] w_LastDir; + RecentDirMenu.push_back(MENU_ITEM(ID_RECENT_DIR_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, MenuString.ToUTF16(CP_ACP).c_str())); } /* File Menu @@ -1279,4 +1273,4 @@ void CMainMenu::ResetMenu(void) ResetAccelerators(); WriteTrace(TraceDebug, __FUNCTION__ ": Done"); -} \ No newline at end of file +} diff --git a/Source/Project64/User Interface/Rom Browser Class.cpp b/Source/Project64/User Interface/Rom Browser Class.cpp index cff591219..b5a075ef1 100644 --- a/Source/Project64/User Interface/Rom Browser Class.cpp +++ b/Source/Project64/User Interface/Rom Browser Class.cpp @@ -1365,7 +1365,7 @@ void CRomBrowser::RomList_GetDispInfo(uint32_t pnmh) switch (m_FieldType[lpdi->item.iSubItem]) { - case RB_FileName: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->FileName).ToUTF16().c_str(), lpdi->item.cchTextMax); break; + case RB_FileName: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->FileName).ToUTF16().c_str(CP_ACP), lpdi->item.cchTextMax); break; case RB_InternalName: wcsncpy(lpdi->item.pszText, pRomInfo->InternalName, lpdi->item.cchTextMax / sizeof(wchar_t)); break; case RB_GoodName: wcsncpy(lpdi->item.pszText, pRomInfo->GoodName, lpdi->item.cchTextMax / sizeof(wchar_t)); break; case RB_CoreNotes: wcsncpy(lpdi->item.pszText, pRomInfo->CoreNotes, lpdi->item.cchTextMax / sizeof(wchar_t)); break; @@ -1928,4 +1928,4 @@ void CRomBrowser::WatchThreadStop(void) m_WatchThread = NULL; m_WatchThreadID = 0; WriteTrace(TraceDebug, __FUNCTION__ ": 5"); -} \ No newline at end of file +}