diff --git a/common/common.cpp b/common/common.cpp index 6ce8f6ecde..7f9e06022a 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -65,9 +65,9 @@ LOCALE_IO::LOCALE_IO() if( m_c_count++ == 0 ) { // Store the user locale name, to restore this locale later, in dtor - m_user_locale = setlocale( LC_ALL, 0 ); + m_user_locale = setlocale( LC_NUMERIC, nullptr ); // Switch the locale to C locale, to read/write files with fp numbers - setlocale( LC_ALL, "C" ); + setlocale( LC_NUMERIC, "C" ); } } @@ -78,7 +78,7 @@ LOCALE_IO::~LOCALE_IO() if( --m_c_count == 0 ) { // revert to the user locale - setlocale( LC_ALL, m_user_locale.c_str() ); + setlocale( LC_NUMERIC, m_user_locale.c_str() ); } } diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 36210f1b37..28eddf91df 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -713,7 +713,7 @@ bool PGM_BASE::SetLanguage( bool first_time ) if( result != dtst ) // string to double encode/decode does not work! Bug detected: // Disable floating point localization: - setlocale( LC_ALL, "C" ); + setlocale( LC_NUMERIC, "C" ); if( !m_locale->IsLoaded( dictionaryName ) ) m_locale->AddCatalog( dictionaryName );