On Sat Jan 27 00:02:05 2001 +0100 Bruno Haible wrote:
> Bram Moolenaar writes:
> >
> > I understand that nl_langinfo(CODESET) obtains the charset name from the
> > current locale. The main problem is that it has a table which will never be
> > finished. I try to keep these things outside of Vim, they require too much
> > maintenance.
>
> The newest portable libiconv-1.5.1 installs a header file "libcharset.h",
> which defines a function locale_charset() as a substitute for
> nl_langinfo(CODESET). It calls nl_langinfo(CODESET) on systems which
> have it, and uses a table for other OSes like FreeBSD (which lacks all
> of <wchar.h>, <wctype.h> and nl_langinfo()). Don't worry about the
> maintenance; I do it for you :-)
>
Reading locale_charset.c it looks like it is obviuosly missing complete
list of ISO 8859 codesets. And when 'codeset' obtained from locale name
doesn't fall into some subset of codeset aliases, it is discarded and
NULL is returned (?) which is wrong IMHO.
And this:
#include <stdlib.h>
#include <locale.h>
#include <libcharset.h>
main ()
{
setlocale(LC_ALL,"");
printf("%s\n", locale_charset());
}
always just prints full locale name instead of charset part for me (?).
--
☻ Ričardas Čepas ☺
~~
~
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/