Subject: Re: Default rune widths for 8-bit characters
To: None <tech-userlevel@netbsd.org>
From: Takehiko NOZAKI <th-nozaki@netwrk.co.jp>
List: tech-userlevel
Date: 10/13/2007 02:26:00
hi, all.

>> I don't think this is correct. The default locale is effectively ASCII
>> and that covers only the first 128 chars.
>
> The default probably ought to be 8859-1

AFAIK,
	#include <locale.h>
	#include <langinfo.h>
	setlocale(LC_CTYPE, "C");
	printf("%s\n", nl_langinfo(CODESET));

may prints:

NetBSD/OpenBSD/Solaris	- 646(=ISO646)
glibc2(SuSE10)		- ANSI_X3.4-1968(=US-ASCII)
FreeBSD/DragonFlyBSD	- US-ASCII


> - or: do the changes only in a special runetable.c compiled into
>  the crunched sysinst (where we know the usage is ok)

i think this is reasonable fix (ugly but easy).

for the future, mininum encoding supports(propablly UTF-8)
should be added to libhack for i18n installer
(whole citrus locale is slight heavy for this purpose).

> > Isn't LC_CTYPE fine for static binaries as well? I think it is enough to
> > provide the correct locale file.
> 
> I copied them over to the ramdisk (after booting) and set LC_CTYPE, but it
> did not work.

it seems that src/distrib/utils/libhack/setlocale.c accepts
'C' locale only, and never read LC_CTYPE database.

very truly yours.
--
Takehiko NOZAKI <tnozaki@NetBSD.org>