On 6 Dec 2007, at 18:13, Graham Dumpleton wrote:
> In Python 3 the default for string type objects will effectively be
> Unicode. Is WSGI going to be made to somehow cope with that, or will
> application instead be required to return byte string objects instead?

I'd say it would be best to only accept `bytes` objects; anything else  
would require some guesswork. Maybe, at most, it could try to encode  
returned Unicode objects as ISO-8859-1, and have it be an error if  
that's not possible.

I was going to say that the gateway could accept Unicode objects if  
the user-agent sent a comprehensible Accept-Charset header, and  
thereby encode application output to the client's preferred character  
set on the fly (or to ISO-8859-1 if no Accept-Charset is provided),  
but that would complicate things for people writing gateways (and  
would be too implicit). It could be useful, but it would make more  
sense as a simple decorator for (almost-)WSGI applications. Perhaps it  
could go in wsgiref.
_______________________________________________
Web-SIG mailing list
Web-SIG@python.org
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: 
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com

Reply via email to