Number format in plot output depends on locale

Asked by Max-Wilhelm Bruker

Dear developers,

Today I learned that decimal numbers in saved or exported files as well as in the printer output are formatted according to the LC_NUMERIC setting. I.e. if I set LC_NUMERIC to e.g. de_DE.UTF-8, the decimal point will be formatted as ",", making the files unreadable. That is, with the exception of SVG files, which can be opened in Inkscape, but in that case, all line widths will be rounded to zero because of the wrong decimal point character. Another unfortunate effect is that Kicad files cannot be shared between users that use a different number format on their systems. As a consequence, I have to start Kicad with LC_NUMERIC="en_US.UTF_8" to be able to export correctly working files.
A trivial example of a corrupt SVG file can be found at http://www.pastebin.ca/2568628
Is this desired behaviour or should it be filed as a bug? The version used is 2014-01-10 BZR 4619 on Ubuntu saucy.
Thanks for your time,
Max

Question information

Language:
English Edit question
Status:
Solved
For:
KiCad Edit question
Assignee:
No assignee Edit question
Solved by:
Max-Wilhelm Bruker
Solved:
Last query:
Last reply:
Revision history for this message
Dick Hollenbeck (dickelbeck) said :
#1

On 01/21/2014 08:01 AM, Max-Wilhelm Bruker wrote:
> New question #242526 on KiCad:
> https://answers.launchpad.net/kicad/+question/242526
>
> Dear developers,
>
> Today I learned that decimal numbers in saved or exported files as well as in the printer output are formatted according to the LC_NUMERIC setting. I.e. if I set LC_NUMERIC to e.g. de_DE.UTF-8, the decimal point will be formatted as ",", making the files unreadable. That is, with the exception of SVG files, which can be opened in Inkscape, but in that case, all line widths will be rounded to zero because of the wrong decimal point character. Another unfortunate effect is that Kicad files cannot be shared between users that use a different number format on their systems. As a consequence, I have to start Kicad with LC_NUMERIC="en_US.UTF_8" to be able to export correctly working files.
> A trivial example of a corrupt SVG file can be found at http://www.pastebin.ca/2568628
> Is this desired behaviour or should it be filed as a bug? The version used is 2014-01-10 BZR 4619 on Ubuntu saucy.
> Thanks for your time,
> Max
>

So what is your question?

How about, "what was your intention?"

KiCad data files should be using the "C" LC_NUMERIC setting. Anything you see other than
that, is indicative of something having gone wrong.

Revision history for this message
Lorenzo Marcantonio (l-marcantonio) said :
#2

On Tue, Jan 21, 2014 at 02:21:19PM -0000, Dick Hollenbeck wrote:
> KiCad data files should be using the "C" LC_NUMERIC setting. Anything you see other than
> that, is indicative of something having gone wrong.

It seems to me that his intention was to report that these SVGs had
*not* the C locale, since were output with the comma instead of the
point... so probably there is something wrong.

--
Lorenzo Marcantonio
Logos Srl

Revision history for this message
Dick Hollenbeck (dickelbeck) said :
#3

On 01/21/2014 08:18 AM, Dick Hollenbeck wrote:
>
>
> On 01/21/2014 08:01 AM, Max-Wilhelm Bruker wrote:
>> New question #242526 on KiCad:
>> https://answers.launchpad.net/kicad/+question/242526
>>
>> Dear developers,
>>
>> Today I learned that decimal numbers in saved or exported files as well as in the printer output are formatted according to the LC_NUMERIC setting. I.e. if I set LC_NUMERIC to e.g. de_DE.UTF-8, the decimal point will be formatted as ",", making the files unreadable. That is, with the exception of SVG files, which can be opened in Inkscape, but in that case, all line widths will be rounded to zero because of the wrong decimal point character. Another unfortunate effect is that Kicad files cannot be shared between users that use a different number format on their systems. As a consequence, I have to start Kicad with LC_NUMERIC="en_US.UTF_8" to be able to export correctly working files.
>> A trivial example of a corrupt SVG file can be found at http://www.pastebin.ca/2568628
>> Is this desired behaviour or should it be filed as a bug? The version used is 2014-01-10 BZR 4619 on Ubuntu saucy.
>> Thanks for your time,
>> Max
>>
>
>
>
> So what is your question?
>
> How about, "what was your intention?"
>
> KiCad data files should be using the "C" LC_NUMERIC setting. Anything you see other than
> that, is indicative of something having gone wrong.
>
>
>

There are suspicions of a recent bug, which would cause the call in

    LOCALE_IO::LOCALE_IO{}

which sets the "C" locale, not to fire if you had previously done a "Load All" in the
footprint picker. If the variable C_count got out of sync with reality, then this could
happen.

Last night a probable fix was committed. So maybe the problem is now gone. Time and
testing will tell.

Revision history for this message
Max-Wilhelm Bruker (brukie) said :
#4

Updating to 2014-01-21 BZR 4628 seems to have fixed the problem for me. Thanks for the quick response and sorry I didn't update before posting; it didn't seem possible at the time because the repository path apparently had changed and I hadn't noticed that until a moment ago.