We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4e19de2 + 333c9e8 commit d7e4839Copy full SHA for d7e4839
lib/HTFeed/Volume.pm
@@ -286,9 +286,13 @@ sub get_checksum_md5 {
286
$self->set_error("MissingFile", file => $checksum_file);
287
}
288
289
- open(FILE, $checksum_path) or die("Can't open $checksum_path: $!");
+ # we don't expect a BOM in checksum files, but get it sometimes anyways
290
+ # so it's best to open files as if they were UTF8 and strip bom if seen
291
+ use open ':std', ':encoding(UTF-8)';
292
+ open(FILE, $checksum_path) or die("Can't open $checksum_path: $!");
293
foreach my $line (<FILE>) {
294
$line =~ s/\r\n$/\n/;
295
+ $line =~ s/^\N{BOM}//;
296
chomp($line);
297
# ignore malformed lines
298
next unless $line =~ /^([a-fA-F0-9]{32})(\s+\*?)(\S.*)/;
0 commit comments