Decimal values rounded on save

Dirk Hohndel dirk at hohndel.org
Mon Sep 3 11:29:34 PDT 2012


On Sep 3, 2012, at 11:24 AM, Linus Torvalds wrote:

> On Mon, Sep 3, 2012 at 11:13 AM, Linus Torvalds
> <torvalds at linux-foundation.org> wrote:
>> 
>> Damn. I guess we can do the usual
>> 
>>        setlocale(LC_NUMERIC,"C");
>> 
>> at the top of main(). Lazy, but the alternative is to do all the FP
>> parsing by hand. We do *not* want the file to be locale-dependent.
> 
> Oh crist.
> 
> It's GTK. What a total piece of crap that library is.

I must have heard this before somewhere.
Oh, right. I said that just a few weeks ago…

> The standard C rules are that the default locale is *always* the "C"
> locale (exactly because nobody wants to have locales affect things
> like parsing config files etc).
> 
> But gtk apparently does the
> 
>        setlocale(LC_ALL, "");
> 
> somewhere, which explains this braindamage.
> 
> And I can fix it, but then the sad part is that the gtk *visual* part
> (where locales etc may well make sense!) will be broken.
> 
> Why the *hell* does GTK do LC_ALL? Using locale data for visual
> elements is fine, but it is *not* fine to then mess things up and set
> locales for the basic C library functions.

This can't be true. There's way too much software that uses gtk for this to be true.
Ask on G+ - I'm sure there's a setting that makes it do the sane thing for basic C library functions…

/D


More information about the subsurface mailing list