[Web-SIG] CGI WSGI and Unicode

Manlio Perillo manlio_perillo at libero.it
Sun Dec 6 14:43:43 CET 2009


Hi.

I'm playing with Python 3.x, current revision.

I have noted that the data in the os.environ are noe Unicode strings.

In a CGI application, HTTP headers are Unicode strings, and are decoded
using system default encoding.
In a future WSGI application, HTTP headers are Unicode strings, and are
decoded using latin-1 encoding.

In both cases, 'surrogateescape' is used.

Can this cause troubles and incompatibility problems?
I'm interested in special header handling, like cookies, that contain
opaque data.


Thanks  Manlio


More information about the Web-SIG mailing list