--- pymsn/gnet/message/HTTP.py.old 2009-07-10 16:21:38.000000000 +0200 +++ pymsn/gnet/message/HTTP.py 2009-07-10 17:07:17.000000000 +0200 @@ -22,6 +22,7 @@ from UserDict import DictMixin from pymsn.gnet.constants import * +import cgi __all__ = ['HTTPMessage', 'HTTPResponse', 'HTTPRequest'] @@ -102,6 +103,20 @@ result.append(str(self.body)) return "\r\n".join(result) + def __unicode__(self): + result = [] + body = str(self.body) + for name in self.headers: + result.append(": ".join((name, str(self.headers[name])))) + #if "Content-Length" not in self.headers: + # result.append("Content-Length: %d" % len(body)) + result.append("") + + contenttype= self.headers.get('Content-Type', 'text/html; charset=iso-8859-1') + charset = cgi.parse_header(contenttype)[1].get('charset', 'iso8859-1') + result.append(str(self.body).decode(charset)) + return "\r\n".join(result) + class HTTPResponse(HTTPMessage): def __init__(self, headers=None, body="", status=200, reason="OK", version="1.0"): --- pymsn/service/SOAPService.py.old 2008-05-22 00:42:31.000000000 +0200 +++ pymsn/service/SOAPService.py 2009-07-10 16:42:42.000000000 +0200 @@ -179,7 +179,7 @@ transport.request(resource, http_headers, request, 'POST') def _response_handler(self, transport, http_response): - logger.debug("<<< " + str(http_response)) + logger.debug("<<< " + unicode(http_response)) soap_response = SOAPResponse(http_response.body) request_id, callback, errback, user_data = self._unref_transport(transport)