]> www.fi.muni.cz Git - evince.git/blobdiff - pdf/xpdf/PDFDoc.cc
new widget: table with labels displaying properties of PDFs
[evince.git] / pdf / xpdf / PDFDoc.cc
index 683e4d2d69d0cc18259fd5254789e32fca7482d3..f3b7f799417c272f705b5b8ffeafd92e58afd09e 100644 (file)
@@ -11,6 +11,7 @@
 #endif
 
 #include <aconf.h>
+#include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
@@ -168,7 +169,11 @@ void PDFDoc::checkHeader() {
   }
   str->moveStart(i);
   p = strtok(&hdrBuf[i+5], " \t\n\r");
-  pdfVersion = atof(p);
+  {
+    char *theLocale = setlocale(LC_NUMERIC, "C");
+    pdfVersion = atof(p);
+    setlocale(LC_NUMERIC, theLocale);
+  }
   if (!(hdrBuf[i+5] >= '0' && hdrBuf[i+5] <= '9') ||
       pdfVersion > supportedPDFVersionNum + 0.0001) {
     error(-1, "PDF version %s -- xpdf supports version %s"