durusmail: quixote-users: utf-8 applications, front to back
utf-8 applications, front to back
2004-12-16
Mario Ruggier (2 parts)
2004-12-17
utf-8 applications, front to back
Mario Ruggier
2004-12-17
Following up on my own post, as possibly others might be interested in
the solution...

David Binger has pointed out to me that the problem is originating from
HTTPResponse._encode_chunk(), and the hack below (to him much to ugly
for general consumption ;) manages to work around this problem:

import quixote.http_response
quixote.http_response.HTTPResponse._encode_chunk = str

So the behaviour of _encode_chunk() will probably need to be
modified... and from my naive understanding, I would think that by
default (when the string is actually str and not unicode) there should
be no encoding performed by the middleware... the encoding in this case
is the responsability of the application. As for processing actual
unicode strings, then i guess it would need to decide on an encoding...
in which case self.charset seems the logical thing to use.

In the meanwhile, I'm very happy and grateful for this little hack...

mario


reply