tags 623361 + patch pending
thanks

The attached patch is a bit cleaner IMHO, and will be included in the
next upload.

Teemu
From: Teemu Ikonen <[email protected]>
Subject: Fix reading of .ply files in locales in comma separator locales
X-git-branch: p/ply_numeric

 .../src/meshlabplugins/filter_plymc/plymc_main.cpp |    9 ---------
 vcglib/wrap/ply/plylib.cpp                         |    6 ++++++
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/meshlab/src/meshlabplugins/filter_plymc/plymc_main.cpp b/meshlab/src/meshlabplugins/filter_plymc/plymc_main.cpp
index 0836de0..8404152 100644
--- a/meshlab/src/meshlabplugins/filter_plymc/plymc_main.cpp
+++ b/meshlab/src/meshlabplugins/filter_plymc/plymc_main.cpp
@@ -109,15 +109,6 @@ int main(int argc, char *argv[])
   tri::PlyMC<SMesh,SimpleMeshProvider<SMesh> > pmc;
   tri::PlyMC<SMesh,SimpleMeshProvider<SMesh> >::Parameter &p = pmc.p;
 
-
-  // This line is required to be sure that the decimal separatore is ALWAYS the . and not the ,
-  // see the comment at the beginning of the file
-#ifdef WIN32
-  setlocale(LC_ALL, "En_US");
-#else
-  std::setlocale(LC_ALL, "En_US");
-#endif
-
   printf(   "\n                  PlyMC "_PLYMC_VER" ("__DATE__")\n"
 	    "   Copyright 2002-2008 Visual Computing Group I.S.T.I. C.N.R.\n"
 	    "             Paolo Cignoni ([email protected])\n\n");
diff --git a/vcglib/wrap/ply/plylib.cpp b/vcglib/wrap/ply/plylib.cpp
index cd28870..22b7de5 100644
--- a/vcglib/wrap/ply/plylib.cpp
+++ b/vcglib/wrap/ply/plylib.cpp
@@ -1046,6 +1046,12 @@ int PlyFile::OpenRead( const char * filename )
 	char * token;
 	PlyElement * curelement;
 
+// This line is required to be sure that the decimal separatore is ALWAYS the . and not the ,
+#ifdef WIN32
+        setlocale(LC_NUMERIC, "C");
+#else
+        std::setlocale(LC_NUMERIC, "C");
+#endif
 		// Predistruzione
 
 	Destroy();

Reply via email to