]> git.phdru.name Git - bookmarks_db.git/commitdiff
Move charset to the beginning of the list.
authorOleg Broytman <phd@phdru.name>
Thu, 12 Aug 2010 09:02:06 +0000 (09:02 +0000)
committerOleg Broytman <phd@phdru.name>
Thu, 12 Aug 2010 09:02:06 +0000 (09:02 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@266 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Robots/parse_html.py

index f50b01b415b5c6fd775fa41cb20325127ebf0469..347ed225ecee372695abdea8db686ad96a77971f 100755 (executable)
@@ -70,8 +70,9 @@ def parse_html(filename, charset=None, log=None):
    charsets = [universal_charset, DEFAULT_CHARSET]
    if charset:
       charset = charset.lower().replace("windows-", "cp")
-      if charset not in charsets:
-         charsets.insert(0, charset)
+      if charset in charsets:
+         charsets.remove(charset)
+      charsets.insert(0, charset)
 
    for p in parsers:
       parser = None