[Python-Dev] Python-3.0, unicode, and os.environ

Adam Olsen rhamph at gmail.com
Fri Dec 12 09:00:26 CET 2008


On Fri, Dec 12, 2008 at 12:33 AM, Toshio Kuratomi <a.badger at gmail.com> wrote:
> Adam Olsen wrote:
>> As a data point, firefox (when pointed at my home dir) DOES skip over
>> garbage files.
>>
>>
> That's not true.  However, it looks like Firefox is actually broken.
> Take a look at this screenshot:
>  firefox.png
>
> That shows a directory with a folder that's not decodable in my utf-8
> locale.  What's interesting to note is that I actually have two
> nondecodable folders there but only one of them showed up.  So firefox
> is inconsistent with its treatment, rendering some non-decodable files
> and ignoring others.
>
> Also interesting, if you point your browser at:
>  http://toshio.fedorapeople.org/u/
>
> You should see two other test files.  They're both
> (one-half)(enyei).html but one's encoded in utf-8 and the other in
> latin-1.  Firefox has some bugs in it related to this.  For instance, if
> you mouseover the two links you'll see that firefox displays the same
> symbolic names for each of the files (even though they're in two
> different encodings).  Sometimes firefox is able to load both files and
> sometimes it only loads one of them.  Firefox seems to be translating
> the characters from ASCII percent encoding of bytes into their unicode
> symbols and back to utf-8 in some circumstances related to whether it
> has the pages in its cache or not.  In this case, it should be leaving
> things as percent encoded bytes as it's the only way that apache is
> going to know what to retrieve.

UTF-8 in percent encodings is becoming a defacto standard.  Otherwise
the browser has to display the percent escapes in the address bar,
rather than the intended text.

IOW, inconsistent behaviour is a bug, but translating into UTF-8 is not. ;)


-- 
Adam Olsen, aka Rhamphoryncus


More information about the Python-Dev mailing list