fix: Handle SRT files with BOM by using utf-8-sig encoding

This commit is contained in:
Emmanuel BENOîT 2025-04-06 11:50:38 +02:00
parent 50d8e6d261
commit a8c72b3efa
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg

View file

@ -1,7 +1,7 @@
import sys
def parse_srt(filename):
with open(filename, 'r', encoding='utf-8') as f:
with open(filename, 'r', encoding='utf-8-sig') as f:
content = f.read().strip()
blocks = content.split('\n\n')
entries = []