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



>> #include <locale.h>

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

Owen> The only problem with this is that it isn't thread safe. (I
Owen> think locales are global, not thread-specific). But I don't know
Owen> if anything can be doen about that...

Good point.  Another choice would be to have a C-locale-specific
strtod() replacement.  There's one in Tcl that we could lift.  If
somebody is working on this, I'd be happy to email them the file.

Tom



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