]> git.phdru.name Git - bookmarks_db.git/commitdiff
Fix(parse_html/bkmk_parse_html.py): Open the file with known encoding
authorOleg Broytman <phd@phdru.name>
Mon, 20 Nov 2023 16:20:31 +0000 (19:20 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 20 Nov 2023 16:20:31 +0000 (19:20 +0300)
parse_html/bkmk_parse_html.py

index 4d5f9e6d11f06ef0b587acca2b608b6443007795..922c745346ecfa8f8f9c2988ef94f85345dc167a 100644 (file)
@@ -211,7 +211,7 @@ def parse_html(html_text, charset=None, log=None):
 
 
 def parse_filename(filename, charset=None, log=None):
-    fp = open(filename, 'rt')
+    fp = open(filename, 'rt', encoding=charset)
     try:
         parser = parse_html(fp.read(), charset=charset, log=log)
     finally: