Message254263
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"). |
|
Date |
User |
Action |
Args |
2015-11-07 08:43:41 | martin.panter | set | recipients:
+ martin.panter, orsenthil, docs@python |
2015-11-07 08:43:40 | martin.panter | set | messageid: <1446885820.73.0.0514095635951.issue25576@psf.upfronthosting.co.za> |
2015-11-07 08:43:40 | martin.panter | link | issue25576 messages |
2015-11-07 08:43:39 | martin.panter | create | |
|