Subject: | SRT subtitle files starting with a BOM can not be read |
SRT subtitle files starting with a UTF-8 BOM can not be read
BOM = http://en.wikipedia.org/wiki/Byte_order_mark
see attached simple patch for a possible solution
Subject: | SRT.patch |
--- Video/Subtitle/SRT.pm.orig 2012-04-25 09:02:42.000000000 +0200
+++ Video/Subtitle/SRT.pm 2013-09-29 10:25:52.244527401 +0200
@@ -43,6 +43,7 @@
binmode $fh, ":raw:eol(LF)";
local $/ = "\n\n";
while (my $chunk = <$fh>) {
+ $chunk=~s/^\xef\xbb\xbf//;
my @chunk = split /\r?\n/, $chunk;
if ($chunk[-1] eq "") {
pop @chunk;