From 91f1d6141fdabb93c21bd0c4c362cedec9ffffe0 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 15 Mar 2012 11:24:55 +0000 Subject: [PATCH] minor fix --- lib/request/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/request/basic.py b/lib/request/basic.py index d76032898..df15c59d5 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -208,7 +208,7 @@ def decodePage(page, contentEncoding, contentType): else: kb.pageEncoding = conf.charset - if contentType and any(map(lambda x: x in contentType.lower(), ('text/txt', 'text/raw', 'text/html', 'text/xml'))): + if contentType and not isinstance(page, unicode) and any(map(lambda x: x in contentType.lower(), ('text/txt', 'text/raw', 'text/html', 'text/xml'))): # can't do for all responses because we need to support binary files too kb.pageEncoding = kb.pageEncoding or checkCharEncoding(getHeuristicCharEncoding(page)) page = getUnicode(page, kb.pageEncoding)