Re: setlocale portability


Subject: Re: setlocale portability
From: Hubert Figuiere (hfiguiere@teaser.fr)
Date: Mon Apr 02 2001 - 08:23:18 CDT


Joaquin Cuenca Abela écrit:

>> My question is how portable is setlocale() to revert locale back to "C" when
>> writting the file ? Because setlocale() can be the solution to the problem.
>
> I don't know, but I remember that the same problem was raised once upon
> a time when we were writting colors in the .ps file (I think that a
> portugues dude solved the problem).

The fix is like mine: surround sprintf(%f) with setlocale() call to use C
locale. This fix is in UNIX code.
This time the problem arise in XP code. That's why I'm wondering about
portabibility outside UNIX code. setlocale() is supposed to be part of
POSIX, but some platform may not support it. Perhaps I should write a UT
wrapper for this.

I'm about to check my fix on Linux/GNOME. This is a 3 LOC fix.

Hub



This archive was generated by hypermail 2b25 : Mon Apr 02 2001 - 08:23:20 CDT