Re: locale affects (infects? ;) strtod()



>> char *old = setlocale (LC_NUMERIC, "C");
>> ... strtod (...)   /* will use C rules */
>> setlocale (LC_NUMERIC, old);
>> 

Tim> so what do we do with the various cases where this is used in
Tim> e.g.  the gimp?

You examine each invocation of strtod by hand.
For those where the data comes from the user, just keep using strtod.
For those where you need C locale rules, use the code above.

Tom



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