[Bug 127015] New - rpm2cpio breaks with UTF-8 locale (RH9 outa the box)



Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

http://bugzilla.gnome.org/show_bug.cgi?id=127015

Changed by ariel primate net 

--- shadow/127015	Fri Nov 14 16:54:57 2003
+++ shadow/127015.tmp.24648	Fri Nov 14 16:54:57 2003
@@ -0,0 +1,38 @@
+Bug#: 127015
+Product: GARNOME
+Version: unspecified
+OS: Linux
+OS Details: RH9
+Status: NEW   
+Resolution: 
+Severity: normal
+Priority: Normal
+Component: general
+AssignedTo: jdub perkypants org                            
+ReportedBy: ariel primate net               
+QAContact: garnome-list gnome org
+TargetMilestone: ---
+URL: 
+Summary: rpm2cpio breaks with UTF-8 locale (RH9 outa the box)
+
+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.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]