From cc8b42ebf41b7fefcd3c0b24e4485fd329d11c22 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 2 Mar 2012 22:37:35 +0100 Subject: [PATCH] add utf-8 BOM to srt --- ox/srt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ox/srt.py b/ox/srt.py index cd41ab6..ca5440f 100644 --- a/ox/srt.py +++ b/ox/srt.py @@ -3,6 +3,7 @@ from __future__ import with_statement, division import chardet import re +import codecs import ox @@ -101,5 +102,5 @@ def encode(data): s['value'].replace('\n', '\r\n').strip() ) i += 1 - return srt.encode('utf-8') + return codecs.BOM_UTF8 + srt.encode('utf-8')