Current-Users archive

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

calling setlocale (Re: Build break - commaizenumber)



On Tue, Mar 15, 2011 at 06:24:18PM -0400, Christos Zoulas wrote:
> On Mar 15, 10:01am, erh%nimenees.com@localhost (Eric Haszlakiewicz) wrote:
> -- Subject: Re: Build break - commaizenumber
> 
> | On Tue, Mar 15, 2011 at 09:54:58AM -0500, Eric Haszlakiewicz wrote:
> | # printf "%'d\n" 12345
> | printf: %': invalid directive
> | 
> | What am I missing?
> 
> printf(1) is not printf(3). And to make it work in the code you need

Ok, a bit unfortunate, but oh well, I'm not going to worry about it.

> to call setlocale(LC_ALL, ""); before calling printf.

I guess I'm a bit confused at to what that means.  The man page says that
"denotes native environment", but it doens't explain how that's different
from the "C" locale, which it says is the standard locale for c programs.
Or, does that mean that calling setlocale with "" causes it to look up the
actual environment variables and set the locale based on that?  (which doesn't
sound exactly like the "native" environment, it's the settings that the
current user overrode the defaults with.)

eric


Home | Main Index | Thread Index | Old Index