[rrd-developers] getting rid of some of the LOCALE magic

Benny Baumann BenBE at geshi.org
Fri Sep 4 12:48:25 CEST 2009


Hi,

The reason for those lines is - I guess - to get a defined language
environment inside the library. I'd more or less correct those to first
query the current env and then set the one the library expects. That way
you avoid some issues with number format conversions especially when
parsing numbers in floating point arguments.

Regards,
BenBE.

Am 04.09.2009 09:54, schrieb Tobias Oetiker:
> People,
>
> in rrd_graph I am calling
>
> #ifdef HAVE_SETLOCALE
>     setlocale(LC_TIME, "");
> #ifdef HAVE_MBSTOWCS
>     setlocale(LC_CTYPE, "");
> #endif
> #endif
>
> this causes the locale settings to be reset to whatever the
> coresponding environment variable sais ... this is nice when people
> set the LC_* variable in the surrounding code ... but it cause
> unexpected behaviour, if people use setlocale when calling rrdtool
> as a library ...
>
> I think about dropping the calls for 1.4 ... what do you think ?
>
> cheers
> tobi
>
>
>
>   


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20090904/3a282fab/attachment.pgp 


More information about the rrd-developers mailing list