From deaef99271dea381f88437f42e582b50b6843562 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 12 Aug 2010 09:02:06 +0000 Subject: [PATCH] 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 --- Robots/parse_html.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.39.5