]> git.phdru.name Git - bookmarks_db.git/commitdiff
Replace BeautifulSoup's guessed cp1252 with DEFAULT_CHARSET.
authorOleg Broytman <phd@phdru.name>
Wed, 13 Feb 2008 18:17:53 +0000 (18:17 +0000)
committerOleg Broytman <phd@phdru.name>
Wed, 13 Feb 2008 18:17:53 +0000 (18:17 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@176 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Robots/parse_html_beautifulsoup.py

index 9b0faded06ab92cb951b844421555776690118ff..c7263fe64b478769e931ab978e4e382ed2233d3c 100644 (file)
@@ -67,6 +67,9 @@ def parse_html(filename, charset=None):
       head = root.html # Some sites put TITLE in HTML without HEAD
 
    _charset = root.originalEncoding
+   if _charset == "windows-1252": # Replace default
+      _charset = DEFAULT_CHARSET
+
    try:
       title = head.title.string.encode(_charset)
    except AttributeError: