This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author v+python
Recipients amaury.forgeotdarc, barry, eric.araujo, erob, flox, ggenellina, oopos, pebbe, pitrou, quentel, r.david.murray, tcourbon, tercero12, tobias, v+python, vstinner
Date 2011-01-11.10:40:03
SpamBayes Score 0.021814963
Marked as misclassified No
Message-id <1294742419.34.0.576130561606.issue4953@psf.upfronthosting.co.za>
In-reply-to
Content
In my previous message I quoted Pierre rightly cautioning about headers containing non-ASCII... and that BytesFeedParser doesn't, so using it to parse headers may be questionable.

So I decided to try one... I show the Live HTTP headers below, from a simple upload form.  What is not so simple is the filename of the file to be uploaded... it contains a couple non-ASCII characters... in fact, one of them is non-latin-1 also: "foöţ.html".  It rather seems that Firefox provides the filename in UTF-8, although Live HTTP headers seems to have displayed it using Latin-1 on the screen!  But in saving it to a file, it didn't write a BOM, and the byte sequence for the filename is definitely UTF-8, and pasted here to be viewed correctly.

So my question: where does Firefox get its authority to encode the filename using UTF-8 ???

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://rkivs.com.gl:8032/row/test.html
Content-Type: multipart/form-data; boundary=---------------------------207991835220448
Content-Length: 304
-----------------------------207991835220448
Content-Disposition: form-data; name="submit"

upload
-----------------------------207991835220448
Content-Disposition: form-data; name="pre"; filename="foöţ.html"
Content-Type: text/html

aoheutns

-----------------------------207991835220448--
History
Date User Action Args
2011-01-11 10:40:19v+pythonsetrecipients: + v+python, barry, amaury.forgeotdarc, ggenellina, pitrou, vstinner, eric.araujo, r.david.murray, oopos, tercero12, tcourbon, tobias, flox, pebbe, quentel, erob
2011-01-11 10:40:19v+pythonsetmessageid: <1294742419.34.0.576130561606.issue4953@psf.upfronthosting.co.za>
2011-01-11 10:40:03v+pythonlinkissue4953 messages
2011-01-11 10:40:03v+pythoncreate