Gentoo Archives: gentoo-ppc-dev

From: Gontran Zepeda <gontran@×××××××.net>
To: gentooppc-dev@g.o
Subject: [gentooppc-dev] glibc, charsets, and iconv. oh my!
Date: Fri, 03 May 2002 13:28:53
So, gnome-extra/gal-0.19 fails to merge due to ./configure failing with :

[ ... ]
checking for catalogs to be installed...  az ca cs da de en_GB es fi fr gl
hu it ja ko lt nn no pl pt pt_BR ro ru sk sv ta tr uk zh_TW
sed: can't read ./intl/ No such file or directory
checking for libxml (aka gnome-xml) libraries 1.8.8 <= version < 2.0.0...
checking for iconv in -liconv... no
checking for iconv... yes
checking for gnu_get_libc_version... yes
checking if iconv() handles UTF-8... no
configure: error: You need to install a working iconv implementation, such
[ ... ]

in config.log 

#include <string.h>
#include <gnu/libc-version.h>

int main (int argc, char **argv)
	const char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
	const char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
	char *transbuf = malloc (10), *trans = transbuf;
	iconv_t cd;
	size_t jp_len = strlen (jp), utf8_len = 10;
	size_t utf8_real_len = strlen (utf8);

	/* glibc 2.1.2's iconv is broken in hard to test ways. */
	if (!strcmp (gnu_get_libc_version (), "2.1.2"))
		exit (1);

	cd = iconv_open ("UTF-8", "ISO-2022-JP");
	if (!cd)
		exit (1);
	if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
		exit (1);
	if (memcmp (utf8, transbuf, utf8_real_len) != 0)
		exit (1);

	exit (0);

So at first I was looking into UTF-8 problems, but it appears, that since 
	% iconv -l 
produces 'UTF-8', BUT NOT 'ISO-2022-JP' that the lack of iconv charset
support for JP specifically, but many others actually, is at issue.

The tricky bit is that % iconv -l on my x86 box produces quite a lot of
output -- maybe 4 times.  Of course, the glibc ebuilds are identical --
with the exception that my x86 glibc was built during a system upgrade and
not build time.

So to test a simple case, could someone who has rebuilt glibc via a portage
upgrade post their output from % iconv -l?



Subject Author
Re: [gentooppc-dev] glibc, charsets, and iconv. oh my! Pieter Van den Abeele <pvdabeel@××××××.be>