root = BeautifulSoup(infile, fromEncoding=charset)
infile.close()
- charset = root.originalEncoding
+ _charset = root.originalEncoding
try:
- title = root.html.head.title.string.encode(charset)
+ title = root.html.head.title.string.encode(_charset)
except AttributeError:
title = ''
else:
icon = None
- parser = BSoupParser(charset, False, title, refresh, icon)
+ parser = BSoupParser(_charset, _charset == charset, title, refresh, icon)
return parser
def _find_refresh(Tag):