diff --git a/uppsrc/Core/App.cpp b/uppsrc/Core/App.cpp index 7875a18a6..a05d3cb68 100644 --- a/uppsrc/Core/App.cpp +++ b/uppsrc/Core/App.cpp @@ -337,8 +337,6 @@ void Exit(int code) throw ExitExc(); } -bool AppNormalExit; - void AppExecute__(void (*app)()) { try { @@ -347,7 +345,6 @@ void AppExecute__(void (*app)()) catch(ExitExc) { return; } - AppNormalExit = true; } #ifdef PLATFORM_POSIX diff --git a/uppsrc/Core/LangInfo.cpp b/uppsrc/Core/LangInfo.cpp index 0eaddddf1..3fdef5001 100644 --- a/uppsrc/Core/LangInfo.cpp +++ b/uppsrc/Core/LangInfo.cpp @@ -244,7 +244,7 @@ LanguageInfo::LanguageInfo() void LanguageInfo::Set(int lang_) { language = lang_; - dword q = sGetLanguageDetails(language, &english_name, &native_name); + dword q = sGetLanguageDetails(language, &english_name, &native_name); if(!q) return; @@ -254,6 +254,10 @@ void LanguageInfo::Set(int lang_) getindexletter = CSCZGetIndexLetter; compare = CSCZLanguageCompare; } + + decimal_point = "."; + thousand_separator = ","; + #ifdef PLATFORM_WIN32 LCID lcid = q; thousand_separator = GetLocaleInfoA(lcid, LOCALE_STHOUSAND); @@ -299,16 +303,9 @@ void LanguageInfo::Set(int lang_) #if defined(PLATFORM_POSIX) && !defined(PLATFORM_ANDROID) String langtext = LNGAsText(language); - char ltext[6]; - ltext[0] = ToLower(langtext[0]); - ltext[1] = ToLower(langtext[1]); - ltext[2] = '_'; - ltext[3] = ToUpper(langtext[3]); - ltext[4] = ToUpper(langtext[4]); - ltext[5] = 0; + String ltext = Format("%c%c_%c%c", ToLower(langtext[0]), ToLower(langtext[1]), ToUpper(langtext[3]), ToUpper(langtext[4])); String oldloc = setlocale(LC_ALL, NULL); - if(setlocale(LC_ALL, ltext)) - { + if(setlocale(LC_ALL, ltext + ".utf8") || setlocale(LC_ALL, ltext + ".UTF-8") || setlocale(LC_ALL, ltext)) { const struct lconv *lc = localeconv(); decimal_point = lc->decimal_point; thousand_separator = lc->thousands_sep; @@ -344,6 +341,7 @@ void LanguageInfo::Set(int lang_) setlocale(LC_ALL, oldloc); } + #endif for(int i = 0; i < 12; i++) { month[i] = month_names[i].ToString(); diff --git a/uppsrc/Core/heapdbg.cpp b/uppsrc/Core/heapdbg.cpp index a72d0b8b9..de976eeeb 100644 --- a/uppsrc/Core/heapdbg.cpp +++ b/uppsrc/Core/heapdbg.cpp @@ -194,7 +194,7 @@ void MemoryDumpLeaks() { if(PanicMode) return; - if(!AppNormalExit) { + if(IsMainRunning()) { VppLog() << "Application was terminated in a non-standard way (e.g. exit(x) call or Ctrl+C)\n"; return; }