Fix incorrect management of C locale in vrml plugin

This commit is contained in:
jp-charras 2016-08-24 14:37:30 +02:00
parent e1ab68638f
commit 4a3cb050ed
1 changed files with 5 additions and 1 deletions

View File

@ -158,15 +158,19 @@ bool CanRender( void )
class LOCALESWITCH
{
// Store the user locale name, to restore this locale later, in dtor
std::string m_locale;
public:
LOCALESWITCH()
{
m_locale = setlocale( LC_NUMERIC, 0 );
setlocale( LC_NUMERIC, "C" );
}
~LOCALESWITCH()
{
setlocale( LC_NUMERIC, "" );
setlocale( LC_NUMERIC, m_locale.c_str() );
}
};