Open hondnl opened 6 years ago
for all others wondering how to do it:
$content = Encoding::fixUTF8(\File::get($filePath));
$parsedContent = $parser
->loadString($content)
->parse();
i also solved this with the forceutf8 package.
Edit: Oh its Laravel based in my case.
Hi there, I also noticed that if a subtitle text has \n\n at the end of it, the next subtitle text is included as the text. This causes an error:
example: the Vanderhall is a great option.\n\n28\n00:01:32,70 --> 00:01:34,70\nNow for the second car of our lineup,\n\n29\n00:01:34,70 --> 00:01:37,80\nat just under $20,000,the Polaris Slingshot\n\n30\n00:01:37,80 --> 00:01:40,60\nhas the least expensive\nstarting price of the group,\n\n31\n00:01:40,60 --> 00:01:42,110\nbut it comes with the most technology. Any ideas how to fix this?
When parsing a srt file and it is not properly encoded into utf-8 it will remove lines.
Example :
I solved it by using https://github.com/neitanod/forceutf8 before parsing the srt.
You might want to implement it ?
Thanks for your project !