tech-userlevel archive

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

Re: setlocale (was: curses vs non-ASCII)



> That's odd.  If you didn't call setlocale() at all, the C library
> should have been using the "C" locale, which doesn't have multi-byte
> characters.  Does some library you linked in call setlocale()?

Maybe, but I don't think that's it, because setlocale(LC_CTYPE,"C")
also results in non-ASCII octets getting dropped.  (It may not be
because of multibyte foo; there may well be something else going on
too.)

>> Are these two things - (a) that setlocale() has to be called for the
>> environment to be recognized and (b) that "" is magic to make it
>> pick up the environment - documented anywhere?
> man 3 setlocale.

The string "environ" appears only three times in that page, none of
which appear to be referring to the environment in the getenv() sense.

>> Is there any documentation on what strings can be put in $LANG et
>> al?
> man 7 nls.

The closest I see there is

     The values of these environment variables contains a string format as:

             language[_territory][.codeset][@modifier]

with a list of languages.  Nothing gave any list of what territories
are valid for a given language, or what codesets are supported, etc.
locale -a, once someone mentioned locale(1), mostly fixes this - I
never discovered locale(1) until someone mentioned it here.

>> Is there any documentation for someone wanting to create a locale?
> man 1 mklocale.

...plus /usr/src/share/locale.  Now that I've discovered it.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index