Re: Can a handler return UTF-8?

Hamish Lawson <[email protected]>
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.