Add a workaround for failed assertion in VS debugger

Assertion failed: ploc->_Mbcurmax == 1 || ploc->_Mbcurmax == 2

Apparently MS C/C++ library doesn't support UTF-8 locales, which causes the assertion to fail. My solution is to ignore the system locale and try to set the classic one.

LibreOffice seems to have this problem fixed in less simple way: https://gerrit.libreoffice.org/#/c/54110/
1008-fix
MrSimbax 2018-07-25 21:44:31 +02:00
parent 32d3d1eb92
commit cb701cacb8
1 changed files with 5 additions and 0 deletions

View File

@ -1832,7 +1832,12 @@ void CApplication::SetLanguage(Language language)
// Update C++ locale
try
{
#if defined(_MSC_VER) && defined(_DEBUG)
// Avoids failed assertion in VS debugger
throw -1;
#else
std::locale::global(std::locale(systemLocale.c_str()));
#endif
}
catch (...)
{