Patch

Peter O'Gorman peter@pogma.com
Sat, 28 Dec 2002 08:45:39 +0000


Hum, sorry, I didn't know that, looks like it is time for yet another 
bug report against apple's libc. In the meantime, if something like 
this does the right thing [tm] on non-broken platforms, could you 
please apply it?

   ;; before doing ANYTHING, set the locale!
   (false-if-exception (setlocale LC_ALL ""))

Of course, I don't know scheme, so if this is not the correct way to do 
this please feel free to fix it :-)

Thanks,
Peter


On Friday, December 27, 2002, at 10:29  PM, Dave Peticolas wrote:

> On Fri, 2002-12-27 at 14:10, Peter O'Gorman wrote:
>> Hi,
>> setlocale LC_ALL "" doesn't work on Mac OS X...
>>
>>
>> Index: src/scm/main.scm
>> ===================================================================
>> RCS file: /home/cvs/cvsroot/gnucash/src/scm/main.scm,v
>> retrieving revision 1.104
>> diff -u -r1.104 main.scm
>> --- src/scm/main.scm    9 Dec 2002 06:44:09 -0000       1.104
>> +++ src/scm/main.scm    27 Dec 2002 22:08:35 -0000
>> @@ -351,7 +351,7 @@
>>     (gnc:setup-debugging)
>>
>>     ;; before doing ANYTHING, set the locale!
>> -  (setlocale LC_ALL "")
>> +  (setlocale LC_ALL "C")
>
> This drastically changes the meaning of this call.
>
> Using "" for the locale tells 'setlocale' to set
> up the locale according to the environment variables
> (LC_ALL, etc.) the user has set up. Using "C" will
> override the user's settings, which is very bad
> for non-US users.
>
> It's a pity that Mac OS X doesn't implement this
> correctly (it's a POSIX standard), but I think
> you ought to find a solution that doesn't break
> things for other systems.
>
> dave
>
> <signature.asc>