From acf31aa24395efd0d0116d85ede9da66e4ed2f78 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 13 Aug 2010 13:04:15 +0000 Subject: [PATCH] Fixed a bug - moved the code where meta_charset is defined. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@276 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- Robots/parse_html_beautifulsoup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Robots/parse_html_beautifulsoup.py b/Robots/parse_html_beautifulsoup.py index 1fa4dc3..d3778fb 100644 --- a/Robots/parse_html_beautifulsoup.py +++ b/Robots/parse_html_beautifulsoup.py @@ -90,9 +90,6 @@ def parse_html(filename, charset=None, log=None): parts.append(part.strip()) title = ''.join(parts) - if _charset or meta_charset: - title = title.encode(_charset or meta_charset) - meta = head.find(_find_contenttype, recursive=False) if meta: try: @@ -108,6 +105,9 @@ def parse_html(filename, charset=None, log=None): else: meta_charset = False + if charset or meta_charset: + title = title.encode(charset or meta_charset) + meta = head.find(_find_refresh, recursive=False) if meta: refresh = meta.get("content") -- 2.39.5