From cb701cacb8f1cf0f0d52c0e778474588e7e88703 Mon Sep 17 00:00:00 2001 From: MrSimbax Date: Wed, 25 Jul 2018 21:44:31 +0200 Subject: [PATCH] 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/ --- src/app/app.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/app.cpp b/src/app/app.cpp index 3444481c..58a58da4 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -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 (...) {