- _charset = root.originalEncoding
- if _charset in ("ISO-8859-2", "windows-1252", "MacCyrillic"): # Replace default
- _charset = DEFAULT_CHARSET
-
- try:
- title = head.title.string.encode(_charset)
- except AttributeError:
- title = '' # HEAD but no TITLE
-
- if (not title) and (head is not html):