From bd1e48eb34d749a3c4231018e676968a6270a77f Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Fri, 13 Dec 2013 23:28:42 +0800 Subject: [PATCH] Use UTF-8 BOM --- danmaku2ass.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/danmaku2ass.py b/danmaku2ass.py index 0cb725d..1a14395 100755 --- a/danmaku2ass.py +++ b/danmaku2ass.py @@ -528,7 +528,7 @@ def MarkCommentRow(rows, c, row): def WriteASSHead(f, width, height, fontface, fontsize, alpha, styleid): f.write( -'''\ufeff +''' [Script Info] ; Script generated by Danmaku2ASS ; https://github.com/m13253/danmaku2ass @@ -625,7 +625,7 @@ def Danmaku2ASS(input_files, output_file, stage_width, stage_height, reserve_bla comments = ReadComments(input_files, font_size) try: if output_file: - fo = ConvertToFile(output_file, 'w', encoding='utf-8', newline='\r\n') + fo = ConvertToFile(output_file, 'w', encoding='utf-8-sig', newline='\r\n') else: fo = sys.stdout ProcessComments(comments, fo, stage_width, stage_height, reserve_blank, font_face, font_size, text_opaque, comment_duration, is_reduce_comments, progress_callback)