On Wed, Apr 1, 2009 at 11:34 AM, Guido van Rossum <gu...@python.org> wrote:
> On Wed, Apr 1, 2009 at 5:18 AM, Robert Brewer <fuman...@aminus.org> wrote:
>> Good timing. We had been thinking to make everything strings except for
>> SCRIPT_NAME, PATH_INFO, and QUERY_STRING, since these few are pulled
>> from the Request-URI, which may be in any encoding. It was thought that
>> the app would be best-qualified to decode those three.
>
> Argh. The *meaning* of these fields is clearly text. It would be most
> unfortunately if all apps were required to deal with decoding bytes
> for these (there is no choice any more, unlike in 2.x). I appreciate
> the sentiment that the encoding is unknown, but I would much prefer it
> if there was a default encoding that the app could override, or if
> there was some other mechanism whereby the app would not have to be
> bothered with decoding bytes unless it cared.

This might be fine, except it is hard.  You can't just take arbitrary
bytes and do script_name.decode('utf8'), and then when you realize you
had it wrong do script_name.encode('utf8').decode('latin1').


-- 
Ian Bicking  |  http://blog.ianbicking.org
_______________________________________________
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