diff --git a/lib/request/basic.py b/lib/request/basic.py index 07dd6f075..8072a35da 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -87,7 +87,7 @@ def parseResponse(page, headers): if absFilePath not in kb.absFilePaths: kb.absFilePaths.add(absFilePath) - + def decodePage(page, contentEncoding, contentType): """ @@ -105,6 +105,6 @@ def decodePage(page, contentEncoding, contentType): #http://stackoverflow.com/questions/1020892/python-urllib2-read-to-unicode if contentType and (contentType.find('charset=') != -1): - page = unicode(page, contentType.split('charset=')[-1]) + page = unicode(page, contentType.split('charset=')[-1]) #don't use getUnicode here. it needs to stay as is. return page diff --git a/lib/request/connect.py b/lib/request/connect.py index 227ad6dc7..fd9185cc8 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -32,6 +32,7 @@ import traceback from lib.contrib import multipartpost from lib.core.common import readInput +from lib.core.common import getUnicode from lib.core.convert import urlencode from lib.core.data import conf from lib.core.data import kb @@ -163,7 +164,7 @@ class Connect: if not cookieStr: cookieStr = "Cookie: " - cookie = unicode(cookie) + cookie = getUnicode(cookie) index = cookie.index(" for ") cookieStr += "%s; " % cookie[8:index] @@ -256,7 +257,7 @@ class Connect: responseMsg += "(%s - %d):\n" % (status, code) if conf.verbose <= 4: - responseMsg += unicode(responseHeaders) + responseMsg += getUnicode(responseHeaders) elif conf.verbose > 4: responseMsg += "%s\n%s\n" % (responseHeaders, page)