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)