X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=src%2Fbundle.pl;h=1659f6ffd7ec096b74cf7a87d1b003ad39a31623;hb=04b34c825e273ea797dc27fa42f0dfe147087e39;hp=ba30a484b4c57842885604c3a86630675b990654;hpb=b2603c13d727c31f8366a86bd4b06fdc7fb2d3f5;p=udpgate.git diff --git a/src/bundle.pl b/src/bundle.pl index ba30a48..1659f6f 100755 --- a/src/bundle.pl +++ b/src/bundle.pl @@ -24,6 +24,8 @@ use strict; use warnings; use File::Basename; +no utf8; +use bytes; # REQUIRED print <<"EOH"; @@ -58,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;