Message70153
Wow, I read the WSGI spec. That seems very strange that it says "HTTP
does not directly support Unicode, and neither does this interface."
Clearly HTTP *does* support Unicode, because it allows you to specify an
encoding.
I assume then that the ISO-8859-1 characters the WSGI functions receive
will be treated as byte values. (That's rather silly; it's just dodging
the issue of Unicode rather than supporting it).
But in any event, the PEP has spoken, so we stick with Latin-1.
With respect to the text/binary stream, I think it would be best if it's
a binary stream, and we explicitly convert those str objects (which WSGI
says must only contain Latin-1 range characters) into bytes objects
(simply treating code points as bytes; in other words calling
.encode('latin-1')) and writing them to the binary stream. (Since the
WSGI spec is so adamant we deal in bytes). |
|
| Date |
User |
Action |
Args |
| 2008-07-22 16:12:21 | mgiuca | set | spambayes_score: 0.00208003 -> 0.00208003 recipients:
+ mgiuca, pje, pitrou |
| 2008-07-22 16:12:20 | mgiuca | set | spambayes_score: 0.00208003 -> 0.00208003 messageid: <1216743140.73.0.476717155968.issue3348@psf.upfronthosting.co.za> |
| 2008-07-22 16:12:20 | mgiuca | link | issue3348 messages |
| 2008-07-22 16:12:19 | mgiuca | create | |
|