From b98cbeee04a3157807b22d5dc36d68acb95609b7 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 27 Jan 2011 22:00:34 +0000 Subject: [PATCH] page for handling binary files --- lib/request/basic.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/request/basic.py b/lib/request/basic.py index 67859a401..f2e0e124a 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -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)