Subject: Re: GLib conversion failure on OpenBSD when building gtk2
To: Alexander Nasonov <alnsn@yandex.ru>
From: Tobias Nygren <tnn@netilium.org>
List: pkgsrc-users
Date: 05/12/2007 12:25:27
On Sat, 12 May 2007 13:36:02 +0400
Alexander Nasonov <alnsn@yandex.ru> wrote:

> Alexander Nasonov wrote:
> > Tobias Nygren wrote:
> > > nl_langinfo(CODESET) returning 646 is not a problem.
> > > Does this work?
> > > $ echo "hello" | /usr/bin/iconv -f UTF-8 -t 646
> > 
> > # /usr/sbin/pkg_add libiconv-1.9.2p3
> > libiconv-1.9.2p3: complete
> > #
> > # echo "hello" | /usr/local/bin/iconv -f UTF-8 -t 646
> > iconv: conversion to 646 unsupported
> 
> BTW, converters/libiconv does support 646 too:
> 
> $ echo "hello" | /usr/pkg/bin/iconv -f UTF-8 -t 646
> /usr/pkg/bin/iconv: conversion to 646 unsupported
> /usr/pkg/bin/iconv: try '/usr/pkg/bin/iconv -l' to get the list of supported encodings
> 
> > > If not, their iconv implementation is broken.
> > > You can work around that by putting this in mk.conf:
> > > _INCOMPAT_ICONV=   OpenBSD-*-*
> > 
> > Thanks, I'll try this.
> 
> It didn't work. For now, I put a patch to $LOCALPATCHES/devel/glib2:
> 
> --- glib/libcharset/localcharset.c.pkgsrc	Sat May 12 13:17:37 2007
> +++ glib/libcharset/localcharset.c	Sat May 12 13:18:34 2007
> @@ -252,7 +252,11 @@
>  
>  #if !(defined WIN32 || defined OS2)
>  
> -# if HAVE_LANGINFO_CODESET
> +# if defined(__OpenBSD__)
> +
> +  codeset = "ISO8859-1";
> +
> +# elif HAVE_LANGINFO_CODESET
>  
>    /* Most systems support nl_langinfo (CODESET) nowadays.  */
>    codeset = nl_langinfo (CODESET);
> 

If this is really broken it would be more beneficial to
find out the root cause. Anyway, "646" is an alias for "ASCII",
which should be used instead of "ISO8859-1".

Apparently /usr/bin/iconv on NetBSD and on Solaris both know about
"646". Gnu iconv doesn't. What implementation does OpenBSD use?
Maybe we should patch converters/libiconv to accept "646".

-T