Fix accidental changing of locale in file-open dialog. Thanks @Mel for bug-report and test-case.

We have to temporarily change LC_CTPYE, but did change LC_ALL. That could in some situations (maybe when LC_CTYPE and LC_NUMERIC where not identical?) lead to LC_NUMERIC (and probably others) being changed afterwards.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5330 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2016-08-22 10:15:16 +00:00
parent bbfb73b97d
commit 7ffdbb728a
1 changed files with 3 additions and 3 deletions

View File

@ -383,10 +383,10 @@ void CGUIFileOpenDialog::deserializeAttributes(io::IAttributes* in, io::SAttribu
void CGUIFileOpenDialog::pathToStringW(irr::core::stringw& result, const irr::io::path& p)
{
#ifndef _IRR_WCHAR_FILESYSTEM
char* oldLocale = setlocale(LC_ALL, NULL);
setlocale(LC_ALL,""); // multibyteToWString is affected by LC_CTYPE. Filenames seem to need the system-locale.
char* oldLocale = setlocale(LC_CTYPE, NULL);
setlocale(LC_CTYPE,""); // multibyteToWString is affected by LC_CTYPE. Filenames seem to need the system-locale.
core::multibyteToWString(result, p);
setlocale(LC_ALL, oldLocale);
setlocale(LC_CTYPE, oldLocale);
#else
result = p.c_str();
#endif