use Debbugs::Versions::Dpkg;
use POSIX qw(ceil);
use File::Copy qw(copy);
+use Encode qw(decode encode);
use Storable qw(dclone);
use List::Util qw(min max);
my %namemap = reverse %fields;
for my $line (@lines) {
+ eval {
+ $line = decode("utf8",$line,Encode::FB_CROAK);
+ };
if ($line =~ /(\S+?): (.*)/) {
my ($name, $value) = (lc $1, $2);
# this is a bit of a hack; we should never, ever have \r
($nn+1)."\n");
unfilelock();
my $nn_hash = get_hashname($nn);
- use IO::File;
- my $t_fh = IO::File->new("/home/don/temp.txt",'a') or die "Unable to open ~don/temp.txt for writing: $!";
- use Data::Dumper;
- print {$t_fh} Dumper({%param,nn => $nn, nn_hash => $nn_hash, nextnumber => qx(cat nextnumber)});
- close $t_fh;
if ($param{copy}) {
my $c_hash = get_hashname($param{copy});
for my $file (qw(log status summary report)) {
# Output field names in proper case, e.g. 'Merged-With'.
my $properfield = $fields{$field};
$properfield =~ s/(?:^|(?<=-))([a-z])/\u$1/g;
- $contents .= "$properfield: $newdata{$field}\n";
+ my $data = $newdata{$field};
+ $contents .= "$properfield: $data\n";
}
}
}
-
+ eval {
+ $contents = encode("utf8",$contents,Encode::FB_CROAK);
+ };
return $contents;
}