gnustep-dev
[Top][All Lists]
Advanced

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

Re: Locale usage


From: Adam Fedor
Subject: Re: Locale usage
Date: Mon, 30 Apr 2001 11:11:03 -0600

Richard Frith-Macdonald wrote:
> 
> On Monday, April 30, 2001, at 03:45 PM, Adam Fedor wrote:
> 
> > Richard Frith-Macdonald wrote:
> >>
> >>
> >> Ideally, the code in GSFormat.m should be extended to handle floats
> >> directly
> >> rather than using sprintf() ... I think any rewriting of sprintf()
> >> output is
> >> going to be error prone and inefficient.
> >>
> >
> > I think you can set the locale to 'C' just for numeric conversion. Would
> > that be sufficient?
> 
> Problem is ... what if something else (possibly in another thread) sets
> it back.
> 

I think you misunderstood me. setlocale allows you to set the locale for
certain operations (such as numberic ones (e.g. LC_NUMERIC)). So at
initialization, we do

setlocale(LC_ALL, current_locale);
setlocale(LC_NUMERIC, "C");

would it ever need to be set back? It seems like this would handle most
cases, and we would have to write something special for the cases you
describe, anyway.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]