alexrj/Slic3r — pull request #1510 by dex4er (2013-11-01 09:06:26+00:00)
Title: Set LC_NUMERIC to C explicitly

Wx library sets LC_NUMERIC to current locale (for me it is pl_PL) and then all numbers generated (printed, dumped, stored as hash keys) contains comma rather than dot.

Wx version: 0.9922

It provokes some errors like:

Argument "9,5" isn't numeric in sort at /home/dexter/src/slic3r/master/lib/Slic3r/Print.pm line 877.

And other errors are more subtle (bad gcode output).

Demonstration for LC_NUMERIC:

$ LC_ALL=pl_PL.UTF-8 perl -MPOSIX=setlocale,LC_NUMERIC -le 'setlocale LC_NUMERIC, ""; $a = 8/7; $h{$a}=1; $i = (keys %h)[0]; printf "%f\t%f\n", $i, POSIX::strtod($i) '
1,000000	1,142857

Solution;

Reset LC_NUMERIC back to "C" after Wx app is created.