Subject: Re: wchar_t unicode on NetBSD?
To: Felicia Neff <fn@panix.com>
From: None <itojun@iijlab.net>
List: tech-userlevel
Date: 08/09/2002 01:41:15
>I am attempting to work with the Mozilla people to get the newest Mozilla
>to compile on NetBSD. They have asked in wchar_t is unicode on NetBSD.
>Besides just posting to a list and asking, how would I find out? --
no, wchar_t is not UCS4. you need to handle wchar_t values as opaque
(we support a lot more things than Unicode, and there's no standard
that says wchar_t is UCS4).
the following program should identify what encodings are supported.
% env LANG=C ./a.out
locale C is supported
% env LANG=ja_JP.ISO2022-JP ./a.out
locale ja_JP.ISO2022-JP is supported
% env LANG=en_US.UTF-8 ./a.out
locale en_US.UTF-8 is supported
% env LANG=bogus ./a.out
locale bogus is not supported
itojun
---
#include <stdio.h>
#include <locale.h>
int
main()
{
if (!getenv("LANG")) {
fprintf(stderr, "LANG unset\n");
exit(1);
}
if (setlocale(LC_ALL, ""))
fprintf(stderr, "locale %s is supported\n", getenv("LANG"));
else
fprintf(stderr, "locale %s is not supported\n", getenv("LANG"));
}