Re: [gtk-list] Re: locale affects (infects! ;) strtod()



On 20 Dec 1997, Tom Tromey wrote:

> Tim> so, for all of these places the conversion will be performed just
> Tim> as if atol() has been used if the locale is different from
> Tim> "POSIX" or "C".  i *really* don't think this would have been the
> Tim> original intention of the various programmers.
> 
> I don't know if the original programmers considered the locale or not.
> 
> But if not, it does not make sense to automatically replace strtod
> with a g_strtod that uses C locale rules.  If the value being
> converted was entered by the user, then it should probably be
> converted according to the locale.

nope, i thought something along the lines of doing a string to double
conversion for either the original locale or the "C" locale.
figuring out wich one works out better is just a matter of comparing
the endptr's (the greater one worked better).

> That means each strtod call must be examined by hand to see whether it
> should be converted.
this could be avoided as well as future problems when using g_strtod().

> 
> Tom
> 

---
ciaoTJ



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