durusmail: quixote-users: Re: Can a handler return UTF-8?
Re: Can a handler return UTF-8?
2005-08-19
Re: Can a handler return UTF-8?
Hamish Lawson
2005-08-19
Neil Schemenauer wrote:

> From http://www.amk.ca/python/howto/unicode:
>
>     "Software should only work with Unicode strings internally,
>     converting to a particular encoding on output."

That's a good principle, but I don't think it would be violated if
HTTPResponse were to delegate to the handler function the
responsibility for producing the encoded output of the response body.
Since many template engines besides Kid produce only encoded strings,
a case could be made for such delegation, avoiding the redundancy of a
potential intermediate decoding. What's the rationale for the fact
that HTTPResponse instead performs the encoding? (I realise that the
current arrangement may not be able to be changed in any case.)


Hamish Lawson
reply