From: Oleg Broytman Date: Fri, 13 Aug 2010 13:04:15 +0000 (+0000) Subject: Fixed a bug - moved the code where meta_charset is defined. X-Git-Tag: v4.5.3~100 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=acf31aa24395efd0d0116d85ede9da66e4ed2f78;p=bookmarks_db.git 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 --- 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")