Re: locale, gui vs command line question?




On 31/1/2010, "David Ne&#269;as" <yeti physics muni cz> wrote:

I've not had to deal with locales before, and I'm trying to understand
what GTK does to the locale when it initializes so I can work around it
and save data files as "C" locale.  I've tried adding
setlocale(LC_NUMERIC, "C") to the start of main, and after calling
gtk_init, but it seems to make no difference.

Generally, changing locale locally is fragile and better avoided.

I've tried the above out by storing the current locale setting, changing
it to "C" and then restoring the locale setting once read/write is
finished and it seems to work (I installed a locale using commas as
decimal point).

But I was told not to do this (on stackoverflow), but without the reason
why - and to use ieee754.h (which is no good considering I'm mainly
using MPFR).

Why is store/change/restore of locale bad?

Thanks.
James.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]