perl-unicode

Re: Determine encoding from $LANG

2001-06-28 10:19:05
Jarkko Hietaniemi writes:

No, we don't call nl_langinfo(CODESET).  We still need to figure out
the correct policy and place for doing that.

For robust CGI processing sometimes it makes sense to not use
locales, that's clear.

But for programs interacting with the user setting the locale should
be a one-liner. In C you write

    setlocale(LC_ALL, "");

In X11 you write

    XtSetLanguageProc(NULL,NULL,NULL);

In Java it is automatic.

It would be nice if in Perl it would be a one-liner as well.

http://clisp.cons.org/~haible/packages-libcharset.html

Alas, IIUC, LGPL is currently slightly incompatible for inclusion
into Perl, for something as central piece of a code as locale
handling.

The LGPL wrapper is only needed for non-glibc systems (those without
nl_langinfo, like DOS and FreeBSD, and those where nl_langinfo returns
non-standardized strings, like Solaris). All we Linuxers really care
about is that on glibc systems, you call nl_langinfo(CODESET).

I will certainly give some thought to the matter.

Thanks!

Bruno

<Prev in Thread] Current Thread [Next in Thread>