Browse Source

* Subtitle::BASE : strip unicode BOM if present

master
Alex 'AdUser' Z 6 years ago
parent
commit
5358623d1c
  1. 2
      lib/Subtitle/BASE.pm

2
lib/Subtitle/BASE.pm

@ -37,6 +37,8 @@ sub from_file {
or return -1; or return -1;
my @lines = <$FH>; my @lines = <$FH>;
close $FH; close $FH;
return unless @lines; # empty file?
$lines[0] =~ s[^\x{EF}\x{BB}\x{BF}][]; # strip BOM
return $self->parse(\@lines); return $self->parse(\@lines);
} }

Loading…
Cancel
Save