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 :-)

That sounds like a good solution.  I could either include libcharset.h with
Vim, or add a configure check for it.  Both are not perfect.  Including
libcharset.h will not take advantage of a newer version which could be
available on the system.  Adding a configure check is OK, but when it fails
there would be something to fall back on anyway.  I'll have to figure out a
good solution for this.

> > 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".

OK.

-- 
The future isn't what it used to be.

 ///  Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.moolenaar.net  \\\
(((   Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim   )))
 \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/

Reply via email to