except (ValueError, LookupError):
charset = None # ...try charset from HTML
- for p in parsers:
- charsets = [universal_charset, DEFAULT_CHARSET]
+ charsets = [universal_charset, DEFAULT_CHARSET]
+ if charset:
+ charset = charset.lower()
if charset not in charsets:
charsets.insert(0, charset)
+
+ for p in parsers:
parser = None
for c in charsets:
try: