Fix incorrect management of C locale in vrml plugin
This commit is contained in:
parent
e1ab68638f
commit
4a3cb050ed
|
@ -158,15 +158,19 @@ bool CanRender( void )
|
||||||
|
|
||||||
class LOCALESWITCH
|
class LOCALESWITCH
|
||||||
{
|
{
|
||||||
|
// Store the user locale name, to restore this locale later, in dtor
|
||||||
|
std::string m_locale;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LOCALESWITCH()
|
LOCALESWITCH()
|
||||||
{
|
{
|
||||||
|
m_locale = setlocale( LC_NUMERIC, 0 );
|
||||||
setlocale( LC_NUMERIC, "C" );
|
setlocale( LC_NUMERIC, "C" );
|
||||||
}
|
}
|
||||||
|
|
||||||
~LOCALESWITCH()
|
~LOCALESWITCH()
|
||||||
{
|
{
|
||||||
setlocale( LC_NUMERIC, "" );
|
setlocale( LC_NUMERIC, m_locale.c_str() );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue