Comment 13 for bug 940638

Revision history for this message
Bernd Kreuss (prof7bit) wrote :

I have seen there is a setlocale(LC_NUMERIC, "C"); in main.cpp but this does not seem to have the desired effect. Either it is too early or something else will reset it to default again later. I have not found any other explicit setlocale doing this in the code, maybe its a side effect of something hidden somewhere much deeper.

Setting LC_NUMERIC explicitely *again* right before it will parse the satellite data will fix the problem for me. The following patch will set it right before the gSatTEME constructor will parse the two tle lines. This patch would completely fix the problem for me:

=== modified file 'plugins/Satellites/src/gSatWrapper.cpp'
--- plugins/Satellites/src/gSatWrapper.cpp 2012-01-11 10:50:37 +0000
+++ plugins/Satellites/src/gSatWrapper.cpp 2012-04-19 13:23:22 +0000
@@ -55,7 +55,8 @@
  // we have a mal-formed input, we will truncate here to be safe
  t1.truncate(130);
  t2.truncate(130);
-
+
+ setlocale(LC_NUMERIC, "C");
  pSatellite = new gSatTEME(designation.toAscii().data(),
                            t1.data(),
                            t2.data());

This is only a quick hack to debug the problem, It should be moved to somewhere a little bit earlier in the plugin so it does not have to be called again and again for every satellite, also maybe somehow it is possible to identify what exactly is responsible for undoing and messing up the setlocale() that was done in main.cpp