From: Oleg Broytman Date: Thu, 12 Aug 2010 09:02:06 +0000 (+0000) Subject: Move charset to the beginning of the list. X-Git-Tag: v4.5.3~110 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=deaef99271dea381f88437f42e582b50b6843562;p=bookmarks_db.git Move charset to the beginning of the list. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@266 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/Robots/parse_html.py b/Robots/parse_html.py index f50b01b..347ed22 100755 --- a/Robots/parse_html.py +++ b/Robots/parse_html.py @@ -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