From: Pedro Lopez-C. <pl...@te...> - 2005-02-13 19:09:12
|
On Sunday 13 February 2005 19:54, Chris Cannam wrote: > Thanks. btw how is it that we can be so sure that the locale is "C" > when we first start up? That is, how do we know we don't need > setlocale(LC_ALL, "C") in main() as well? I presume it's documented > somewhere that glibc will default to "C" locale unless we expressly > tell it otherwise... is it? or have we just got lucky so far? It is documented in setlocale(3). "On startup of the main program, the portable C locale is selected as default. A program may be made portable to all locales by calling setlocale(LC_ALL, ) after program initialization, by using the values returned from a localeconv() call for locale - dependent information, by using the multi-byte and wide character functions for text processing if MB_CUR_MAX > 1, and by using strcoll(), wcscoll() or strxfrm(), wcsxfrm() to compare strings. " http://linuxreviews.org/man/setlocale/ Regards, Pedro |