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 martin.panter
Recipients docs@python, martin.panter, orsenthil
Date 2015-11-07.08:43:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1446885820.73.0.0514095635951.issue25576@psf.upfronthosting.co.za>
In-reply-to
Content
I understand using a “charset” parameter with “Content-Type: application/x-www-form-urlencoded” is not standardized. Since Issue 11082, the documentation advises to use it, but I propose to remove this advice.

HTML 5 mentions setting a _charset_ parameter, and mentions decoding with a default of UTF-8 (not Latin-1!), but does not mention any Content-Type parameters.

There seems to be confusion about what encoding it actually represents. According to <https://bugzilla.mozilla.org/show_bug.cgi?id=7533>, Mozilla briefly set this “charset” parameter a long time ago, but it would have corresponded to the urlencode(encoding=...) argument. The Python documentation currently suggests calling data.encode("utf-8"), which is misleading, because the urlencode() output is already guaranteed to be ASCII text. Any non-ASCII characters and bytes will already be character-encoded and percent-encoded by urlencode(). So I also propose to change the examples to data.encode("ascii").
History
Date User Action Args
2015-11-07 08:43:41martin.pantersetrecipients: + martin.panter, orsenthil, docs@python
2015-11-07 08:43:40martin.pantersetmessageid: <1446885820.73.0.0514095635951.issue25576@psf.upfronthosting.co.za>
2015-11-07 08:43:40martin.panterlinkissue25576 messages
2015-11-07 08:43:39martin.pantercreate