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
This commit is contained in:
Jake.Stine 2010-10-05 14:31:17 +00:00
parent dbf1a1c7aa
commit 53ebbc0242
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}