浏览代码

Merge branch 'master' into master

Zoltan Baldaszti 5 年之前
父节点
当前提交
c49e67ee1e
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      contrib/irrXML/CXMLReaderImpl.h

+ 8 - 2
contrib/irrXML/CXMLReaderImpl.h

@@ -15,6 +15,9 @@
 #include <cstdint>
 #include <cstdint>
 //using namespace Assimp;
 //using namespace Assimp;
 
 
+// For locale independent number conversion
+#include <sstream>
+#include <locale>
 
 
 #ifdef _DEBUG
 #ifdef _DEBUG
 #define IRR_DEBUGPRINT(x) printf((x));
 #define IRR_DEBUGPRINT(x) printf((x));
@@ -178,8 +181,11 @@ public:
 			return 0;
 			return 0;
 
 
 		core::stringc c = attrvalue;
 		core::stringc c = attrvalue;
-        return static_cast<float>(atof(c.c_str()));
-		//return fast_atof(c.c_str());
+		std::istringstream sstr(c.c_str());
+		sstr.imbue(std::locale("C")); // Locale free number convert
+		float fNum;
+		sstr >> fNum;
+		return fNum;
 	}
 	}