]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/parse_html_beautifulsoup.py
Replace BeautifulSoup's guessed cp1252 with DEFAULT_CHARSET.
[bookmarks_db.git] / 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: