rmmh / skybot

Python IRC bot
https://github.com/rmmh/skybot/wiki
The Unlicense
249 stars 170 forks source link

handle the encoding of a text document in http.get #184

Closed imnotjames closed 4 years ago

imnotjames commented 6 years ago

This updates the http.get method to properly read the content-type encoding parameter and convert the output based on that encoding.

Code is similar to code from requests library - requests handles this as part of their library automatically. I tested against a few different plugins, and it seems to work as expected still.

This also fixes an issue where a page I'm writing a plugin for has an encoding which isn't properly handled.