page for handling binary files

This commit is contained in:
Miroslav Stampar 2011-01-27 22:00:34 +00:00
parent 8e74c571bc
commit b98cbeee04

View File

@ -145,7 +145,10 @@ def decodePage(page, contentEncoding, contentType):
charset = checkCharEncoding(charset)
kb.pageEncoding = charset or DEFAULT_PAGE_ENCODING
return getUnicode(page, kb.pageEncoding)
if contentType and any(map(lambda x: x in contentType, ('text/html', 'text/txt'))):
page = getUnicode(page, kb.pageEncoding)
return page
def processResponse(page, responseHeaders):
page = getUnicode(page)