]> git.pld-linux.org Git - packages/subconv.git/commitdiff
- rel 6; skip utf8 bom master auto/th/subconv-0.4-6
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 8 Nov 2015 22:30:56 +0000 (23:30 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 8 Nov 2015 22:30:56 +0000 (23:30 +0100)
subconv.py
subconv.spec

index 8cfd8e51dc83d66ea16752a35bc728fecedf6dd3..4b23902bdde7ce1161dca8ac785d69d02e68d4d3 100644 (file)
@@ -4,11 +4,12 @@
 # divx subtitles converter by Pawel Stolowski, Julien Lerouge
 # mpl2 by Grzegorz Zyla
 #
-# Maintained at http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/subconv/
+# Maintained at http://git.pld-linux.org/packages/subconv/
 #
 # Released under terms of GNU GPL
 #
 
+import codecs
 import re
 import sys
 import getopt
@@ -431,6 +432,11 @@ def read_subs(file,fmt,fps):
     src = open(file,'r')
     subs = src.readlines()
     src.close()
+
+    # skip utf8 BOM
+    if len(subs) and len(subs[0]) > 3 and subs[0][0:3] == codecs.BOM_UTF8:
+        subs[0] = subs[0][3:]
+
     if fmt == "tmp":
         return read_tmp(subs)
     elif fmt == "srt":
@@ -442,7 +448,7 @@ def read_subs(file,fmt,fps):
                 fps = detect_fps(subs)
         return read_mdvd(subs, fps)
     elif fmt == "auto":
-       fmt = detect_format(subs)
+        fmt = detect_format(subs)
         sys.stderr.write("Guessing subs format .. %s\n" % fmt )
         return read_subs(file,fmt,fps)
     elif fmt == "sub2":
index f06ad8efcdcf41dcbfae056bcb1a8eb0315020ad..a85c42e553839703d43e156ce35a5aae301c8602 100644 (file)
@@ -1,7 +1,7 @@
 Summary:       Subtitle formats converter
 Name:          subconv
 Version:       0.4
-Release:       5
+Release:       6
 License:       GPL
 Group:         Applications/System
 Source0:       %{name}.py
This page took 0.125767 seconds and 4 git commands to generate.