"""
__author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 2010-2012 PhiloSoft Design"
+__copyright__ = "Copyright (C) 2010-2013 PhiloSoft Design"
__license__ = "GNU GPL"
__all__ = ['parse_html']
title = ''
for node in head.childNodes:
- if node.name == 'meta' and \
+ if (node.name == 'meta') and \
('http-equiv' in node.attributes) and \
(node.attributes['http-equiv'] == 'content-type'):
meta_content = node.attributes['content']
meta_charset = False
else:
break
+ elif (node.name == 'meta') and ('charset' in node.attributes):
+ meta_charset = node.attributes['charset'].lower()
+ break
if not charset:
charset = parser.tokenizer.stream.charEncoding[0]