Subject: Re: iconv_open() / UCS-2-INTERNAL question
To: None <current-users@netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: current-users
Date: 01/30/2007 04:41:02
Chuck Cranor wrote:
> http://gphoto.svn.sourceforge.net/viewvc/gphoto/trunk/libgphoto2/camlibs/ptp2/library.c?r1=9110&r2=9119
>
>
> then, later on, in revision 9163 log they say
> "fixed iconv for interesting operating systems" and added this
> "UCS-2-INTERNAL" thing which breaks on NetBSD:
>
> http://gphoto.svn.sourceforge.net/viewvc/gphoto/trunk/libgphoto2/camlibs/ptp2/library.c?r1=9162&r2=9163
>
> The ifdef basically means that Linux uses "UCS-2" and BSD/MacOS use
> "UCS-2-INTERNAL"
Well, if it's not glibc, it must be Mac OS, right?. UCS-2-INTERNAL seems to be
an Apple thing actually. In any case, they should be trying all known variants
at runtime instead of hardcoding whatever at compile-time. I don't think
assuming iconv() supports any kind of UCS-2 is very portable, using UTF-8 and
converting from/to UCS-2 by hand if required would be better and incidently UTF-8
doesn't have any endian issues.
--
Christian