respect locale environment except for LC_NUMERIC

fixes #1852
This commit is contained in:
Sebastian Hoogen 2014-12-09 17:24:34 +01:00
parent be38772631
commit f32caef40c
2 changed files with 3 additions and 9 deletions

View File

@ -67,12 +67,8 @@ const char sBanner[] = "(c) Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2
int main( int argc, char ** argv ) int main( int argc, char ** argv )
{ {
// Make sure that we use '.' as decimal point // Make sure that we use '.' as decimal point
#if defined(FC_OS_LINUX) setlocale(LC_ALL, "");
putenv("LANG=C");
putenv("LC_ALL=C");
#else
setlocale(LC_NUMERIC, "C"); setlocale(LC_NUMERIC, "C");
#endif
// Name and Version of the Application // Name and Version of the Application
App::Application::Config()["ExeName"] = "FreeCAD"; App::Application::Config()["ExeName"] = "FreeCAD";

View File

@ -191,13 +191,11 @@ int main( int argc, char ** argv )
QFile::setDecodingFunction(myDecoderFunc); QFile::setDecodingFunction(myDecoderFunc);
// Make sure that we use '.' as decimal point. See also // Make sure that we use '.' as decimal point. See also
// http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559846 // http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559846
putenv("LANG=C"); putenv("LC_NUMERIC=C");
putenv("LC_ALL=C");
putenv("PYTHONPATH="); putenv("PYTHONPATH=");
#elif defined(FC_OS_MACOSX) #elif defined(FC_OS_MACOSX)
(void)QLocale::system(); (void)QLocale::system();
putenv("LANG=C"); putenv("LC_NUMERIC=C");
putenv("LC_ALL=C");
putenv("PYTHONPATH="); putenv("PYTHONPATH=");
#else #else
setlocale(LC_NUMERIC, "C"); setlocale(LC_NUMERIC, "C");