From a258642774a5686e9a1fe5a041044d697cf8b9f6 Mon Sep 17 00:00:00 2001 From: dmv Date: Fri, 16 Oct 2009 08:11:12 +0000 Subject: [PATCH] 0020532: [CEA] V5.1.3rc1 - Geom test fails --- src/IGESExport/IGESExport.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/IGESExport/IGESExport.cxx b/src/IGESExport/IGESExport.cxx index 23ecf22bc..d1ccdbf1e 100644 --- a/src/IGESExport/IGESExport.cxx +++ b/src/IGESExport/IGESExport.cxx @@ -73,6 +73,10 @@ IGESEXPORT_EXPORT if (theFormatName.IsEqual("IGES_5_3")) aBrepMode = 1; + // Set "C" numeric locale to save numbers correctly + std::string aCurLocale = setlocale(LC_NUMERIC, 0); + setlocale(LC_NUMERIC, "C"); + // initialize writer IGESControl_Controller::Init(); //IGESControl_Writer ICW (Interface_Static::CVal("write.iges.unit"), @@ -83,7 +87,11 @@ IGESEXPORT_EXPORT // perform shape writing ICW.AddShape( theShape ); ICW.ComputeModel(); - if ( ICW.Write( theFileName.ToCString() ) ) + bool ok = ICW.Write( theFileName.ToCString() ); + + // Return previous locale + setlocale(LC_NUMERIC, aCurLocale.data()); + if ( ok ) return 1; } catch(Standard_Failure) -- 2.39.2