git://git.jankratochvil.net
/
udpgate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9e17f97
)
Fixed utf8-related Perl corruption of the bundled data.
author
short
<>
Sun, 6 Jun 2004 13:48:29 +0000
(13:48 +0000)
committer
short
<>
Sun, 6 Jun 2004 13:48:29 +0000
(13:48 +0000)
src/bundle.pl
patch
|
blob
|
history
diff --git
a/src/bundle.pl
b/src/bundle.pl
index
860179b
..
1659f6f
100755
(executable)
--- a/
src/bundle.pl
+++ b/
src/bundle.pl
@@
-24,7
+24,8
@@
use strict;
use warnings;
use File::Basename;
use warnings;
use File::Basename;
-use bytes;
+no utf8;
+use bytes; # REQUIRED
print <<"EOH";
print <<"EOH";
@@
-59,7
+60,9
@@
for my $pathname (@ARGV) {
"filename" =>$filename,
"filename_sym"=>$filename_sym,
};
"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;
my $Fout=unpack "H*",$F;
$Fout=~s/../0x$&,/g;
$Fout=~s/(?:.....){1,16}/\t\t$&\n/g;