slang-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] slang 2 development snapshot released


On Mon, 4 Oct 2004, John E. Davis wrote:

> Thanks for the patch.  Would the original code have worked on your
> system had I commented out the portion of the code that checks for the
> delimiter?  That is, this part:
>
> 	if ((*locale == 0) || (*locale == '@')
> 	    || (*locale == '+') || (*locale == ','))
> 	  return 1;

No, unless you only mean the first two of those lines:

      /* if ((*locale == 0) || (*locale == '@')
 	    || (*locale == '+') || (*locale == ',')) */
          return 1;

> Incidently, what system are you using?

Debian 3.1, glibc 2.3.2. I since found out that it only happens when
LC_ALL is not set and LC_CTYPE is set to something else than LANG. So,
e.g. if I set
LANG=en_NZ
LC_CTYPE=en_NZ.utf8
and unset all other LC_* environment variables, then setlocale returns
LC_CTYPE=en_NZ.utf8;LC_NUMERIC=en_NZ;LC_TIME=en_NZ;LC_COLLATE=en_NZ;LC_MONETARY=en_NZ;LC_MESSAGES=en_NZ;LC_PAPER=en_NZ;LC_NAME=en_NZ;LC_ADDRESS=en_NZ;LC_TELEPHONE=en_NZ;LC_MEASUREMENT=en_NZ;LC_IDENTIFICATION=en_NZ

According to
http://www.cl.cam.ac.uk/~mgk25/unicode.html
nl_langinfo(CODESET) (if available) is still better though, because using
LC_CTYPE "relies of course on all UTF-8 locales having the name of
the encoding in their name, which is not always the case, therefore the
nl_langinfo() query is clearly the better method."

Bart


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]