[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patches against sh-utils 2.0.11
From: |
Ulrich Drepper |
Subject: |
Re: Patches against sh-utils 2.0.11 |
Date: |
18 Aug 2001 04:40:30 -0700 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.2 (Thelxepeia) |
Jim Meyering <address@hidden> writes:
> Thanks for pointing that out.
> For my edification, why is it a bad idea to set both LC_TIME and LC_CTYPE?
There is no guarantee that the implementation doesn't have more
inter-dependencies between the locale categories. The whole concept
of different locale categories seemed nice in the beginning but it is
fatally flawed.
> Peter's point is still valid. I don't want the setting of LC_ALL=C
> for strftime to force all diagnostics into that locale.
> What do you think of this alternative?
Well, this should be fine everywhere. Strictly speaking used have to
do something like this:
setlocale (LC_ALL, "C");
charset = strdup (nl_langinfo (CODESET));
strftime (buf, ....)
setlocale (LC_ALL, "old value");
cd = iconv_open (nl_langinfo (CODESET), charset);
iconv (cd, buf, ..., buf2, ...)
printf ("%s", buf2)
*Strictly* speaking. The C locale is required to use ASCII and all
systems should require locales to use ASCII-compatible charsets. I
don't know how EBCDIC systems work but they somehow manage it.
I wouldn't implement the above but maybe you can keep it in the back
of your head.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------