From 53ebbc0242a2d430037687609b530e261bb18c4c Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 5 Oct 2010 14:31:17 +0000 Subject: [PATCH] Lilypad: fix ini file support on non-english systems (unicode compliance issue). Details: The "%S" directive in sprintf() only does a shallow wide char conversion from ASCII, it does not actually convert UTF8 to UTF16. Replaced it with a call to MultiByteToWideChar. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3878 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/LilyPad/Config.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index 3144acd96c..cd16f07553 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -277,8 +277,11 @@ static wchar_t iniFile[MAX_PATH*2] = L"inis\\LilyPad.ini"; void CALLBACK PADsetSettingsDir( const char *dir ) { // emulator assures a trailing slash/backslash (yay!) - swprintf_s( iniFile, L"%S", (dir==NULL) ? "inis\\" : dir ); - wcscat(iniFile, L"LilyPad.ini"); + //swprintf_s( iniFile, L"%S", (dir==NULL) ? "inis\\" : dir ); + + //uint targlen = MultiByteToWideChar(CP_UTF8, 0, dir, -1, NULL, 0); + MultiByteToWideChar(CP_UTF8, 0, dir, -1, iniFile, MAX_PATH*2); + wcscat_s(iniFile, L"LilyPad.ini"); createIniDir = false; }