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 :-)
> Isn't there an X-windows function that does something similar?
Given the maintenance nightmare of X11's locale.alias file, the
results of libX11 functions are certainly less reliable than
"libcharset.h".
Bruno
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/