]> git.phdru.name Git - bookmarks_db.git/blobdiff - parse_html/bkmk_ph_htmlparser.py
Parse <meta charset="...">
[bookmarks_db.git] / parse_html / bkmk_ph_htmlparser.py
index 8cdd240a06c7fb3514e79eb9df571dcf1b67279c..d7020b03e933a9d822c541fe9c3936a5e0310ee1 100644 (file)
@@ -4,7 +4,7 @@ This file is a part of Bookmarks database and Internet robot.
 """
 
 __author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 1997-2012 PhiloSoft Design"
+__copyright__ = "Copyright (C) 1997-2013 PhiloSoft Design"
 __license__ = "GNU GPL"
 
 __all__ = ['parse_html']
@@ -40,6 +40,9 @@ class HTMLParser(_HTMLParser):
                http_equiv = value.lower()
             elif attrname == 'content':
                content = value
+            elif (attrname == 'charset') and (not self.charset):
+               self.charset = value.lower()
+               self.meta_charset = 1
 
       if (not self.charset) and (http_equiv == "content-type"):
          try: