>It's also a bit uglier than I wanted because the locale is named
>en_US.utf8 but LC_ALL is named en_US.UTF-8.  Is there a way for
>them to be the same (ignoring case)?

This makes the tests not run on MacOS X, because "locale -a" shows the
locale listings with UTF-8, not utf8 There seems to be no uniformity
here in the mechanics of how locale(1) works; see the differing output
between different operating systems for "locale LC_CTYPE".  I would
personally argue that the Linux implementation seems to be wrong; locale
-m everywhere seems to show a character set of UTF-8 (the character set
that is in the MIME registry).

I think the only true solution here is to create a test program.  I
cooked up a simple something that I've attached below that seems to do
the job, but it will probably need to be adapted a bit.  Given that this
is a bit more complicated than expected, I do not believe it should be
in 1.6.

--Ken
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>

int
main(int argc, char *argv[])
{
    if (argc != 2) {
	fprintf(stderr, "Usage: %s locale-name\n", argv[0]);
    }

    if (!setlocale(LC_ALL, argv[1])) {
	fprintf(stderr, "Invalid locale: %s\n", argv[1]);
	exit(1);
    }

    exit(0);
}
_______________________________________________
Nmh-workers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/nmh-workers

Reply via email to