Fixed utf8-related Perl corruption of the bundled data.
authorshort <>
Sun, 6 Jun 2004 13:48:29 +0000 (13:48 +0000)
committershort <>
Sun, 6 Jun 2004 13:48:29 +0000 (13:48 +0000)
src/bundle.pl

index 860179b..1659f6f 100755 (executable)
@@ -24,7 +24,8 @@ use strict;
 use warnings;
 
 use File::Basename;
-use bytes;
+no utf8;
+use bytes;     # REQUIRED
 
 
 print <<"EOH";
@@ -59,7 +60,9 @@ for my $pathname (@ARGV) {
                        "filename"    =>$filename,
                        "filename_sym"=>$filename_sym,
                        };
-       $F=pack("N*",length($F)).$F;    # Prefix 32-bit network byte order file length.
+       # Do not: pack("N",length($F)).$F
+       # as there would be utf8 encoding hassle.
+       $F=pack("Na*",length($F),$F);   # Prefix 32-bit network byte order file length.
        my $Fout=unpack "H*",$F;
        $Fout=~s/../0x$&,/g;
        $Fout=~s/(?:.....){1,16}/\t\t$&\n/g;