[Python-ideas] Fall back to encoding unicode strings in utf-8 if latin-1 fails in http.client

Andrew Barnert abarnert at yahoo.com
Thu Jan 7 15:04:04 EST 2016


On Jan 7, 2016, at 11:40, Emil Stenström <em at kth.se> wrote:
> 
> Agreed. I would also suggest adding the suggestion of encoding in "utf-8" specifically which is most likely what will fix the problem. As time goes by and more and more legacy systems disappear, this advise will become truer each year.

I disagree. Services that take raw, unformatted text as HTTP bodies and do something useful with it are disappearing in general, not changing the encoding they use for that raw, unformatted text from Latin-1 to UTF-8. And they were never that common in the first place.

So we shouldn't be making it easier to send raw, unformatted text as UTF-8; we should be making it easier to send JSON, form-encoded, multipart, XML, etc. Which, again, Requests already does.


More information about the Python-ideas mailing list