GNOME Bugzilla – Bug 127015
rpm2cpio breaks with UTF-8 locale (RH9 outa the box)
Last modified: 2004-12-22 21:47:04 UTC
garnome 0.27.1 rpm2cpio perl script breaks if you are using a locale (LANG, LANGUAGE, etc.) with UTF-8 in the string. Perl invokes the <:utf8> layer for all open()s and so the first read of 96 characters will be a read of some larger number of bytes... because a few 2-byte sequences happen to be legitimate utf-8 encodings. This means that no header will be found and rpm2cpio barfs. The fix is to set binmode on both input and output streams: 54c54,55 < open(F, "< $ARGV[0]") or die "Can't read file $ARGV[0]\n"; --- > open(F, '<', "$ARGV[0]") or die "Can't read file $ARGV[0]\n"; > binmode(F); 102a104 > binmode(ZCAT); Note that I checked this only for perl 5.8 and have no idea what happens with perl 6.x.
Agreed. Patch has been applied in both GARNOME trees.