Subject: LC_CTYPE locale from citrus xpg4dl codebase
To: None <tech-userlevel@netbsd.org>
From: Jun-ichiro itojun Hagino <itojun@iijlab.net>
List: tech-userlevel
Date: 12/22/2000 11:33:25
I've imported LC_CTYPE locale code from citrus xpg4dl codebase,
into netbsd-current.
at this moment we enable singlebyte locales handling code only.
we have enough code for multibyte locales (including stateful
encodings), and will be enabled shortly after some cleanups
if you would like to play with it, be sure to have:
- very latest libc,
- /usr/bin/mklocale,
- /usr/share/locale/*/LC_CTYPE (generate from src/share/mklocale)
and sample code is as folllows.
if you find any problem, please report:
- even if you are using old LC_CTYPE declaration files (handled by
lib/libc/locale/ctypeio.c), you are still okay. we have backward
compatibility code in libc to handle old LC_CTYPE declaration files.
if not, please report.
- errors in LC_CTYPE locale declaration files. we don't speak
those languages...
- other issues/reports like audit.
itojun & citrus guys
(they should present different results)
% ./a.out
% env LANG=es_ES.ISO8859-15 ./a.out
--
#include <stdio.h>
#include <locale.h>
#include <wctype.h>
main()
{
wint_t i;
setlocale(LC_CTYPE, "");
printf("isalnum for %s:\n", setlocale(LC_CTYPE, NULL));
for (i = L'\0'; i <= L'\377'; i++) {
printf("%c ", iswalnum(i) ? '*' : '_');
if (i % 16 == 15)
printf("\n");
}
}