Debug message with declared page charset

This commit is contained in:
Miroslav Stampar 2012-12-19 11:16:42 +01:00
parent d29dddf5b2
commit 155c1eddae

View File

@ -222,9 +222,11 @@ def decodePage(page, contentEncoding, contentType):
metaCharset = checkCharEncoding(extractRegexResult(META_CHARSET_REGEX, page))
if ((httpCharset or metaCharset) and not all([httpCharset, metaCharset]))\
or (httpCharset == metaCharset and all([httpCharset, metaCharset])):
if (any((httpCharset, metaCharset)) and not all((httpCharset, metaCharset)))\
or (httpCharset == metaCharset and all((httpCharset, metaCharset))):
kb.pageEncoding = httpCharset or metaCharset
debugMsg = "declared web page charset '%s'" % kb.pageEncoding
singleTimeLogMessage(debugMsg, logging.DEBUG, debugMsg)
else:
kb.pageEncoding = None
else: