X-Git-Url: https://code.th-h.de/?p=usenet%2Fnewsstats.git;a=blobdiff_plain;f=bin%2Fparsedb.pl;fp=bin%2Fparsedb.pl;h=8004cb1f2d2e35d4a34f51ee89a15929bbd14b22;hp=b4c20566ede19eb318ff5d90168b39bb778ca540;hb=a586a217c9795bdc506fc811ff24072413424055;hpb=84e9923abeadcfb488985b9e60eb78d4eaa950fd diff --git a/bin/parsedb.pl b/bin/parsedb.pl index b4c2056..8004cb1 100755 --- a/bin/parsedb.pl +++ b/bin/parsedb.pl @@ -198,6 +198,11 @@ while (my $HeadersR = $DBQuery->fetchrow_hashref) { $Headers{$HeaderName.'_parsed'} = decode('MIME-Header',$Headers{$_}) if (exists($LegalEncodings{$Encoding})); } + # forcibly modify headers with un-encoded 8bit data assuming utf-8 + # TODO: try to guess correct enconding + elsif ($Headers{$_} =~ /[^\x00-\x7F]/) { + $Headers{$_} = decode('utf-8',$Headers{$_}); + } # extract name(s) and mail(s) from From: / Sender: / Reply-To: # in parsed form, if available if ($_ ne 'subject') { @@ -258,9 +263,9 @@ while (my $HeadersR = $DBQuery->fetchrow_hashref) { split(/ /,'? ' x scalar(@DBFields))) )); $DBWrite->execute(@SQLBindVars) - or &Bleat(2,sprintf("Can't write parsed data for %s to %s.%s: ". + or &Bleat(2,sprintf("Can't write parsed data for %s to %s.%s for %s: ". "$DBI::errstr\n",$Period, - $Conf{'DBDatabase'},$Conf{'DBTableParse'})); + $Conf{'DBDatabase'},$Conf{'DBTableParse'}, $Headers{'mid'})); $DBWrite->finish; } };