When you make a request, Requests makes educated guesses about the encoding of the response based on the HTTP headers. The text encoding guessed by Requests is used when you access r.text. You can find out what encoding Requests is using, and change it, using the r.encoding property.
If you change the encoding, Requests will use the new value of r.encoding whenever you call r.text.
#to view encoding r.encoding #to change encoding r.encoding = 'ISO-8859-1'
import requests r=requests.get('http://example.com') print(r.encoding) #displays encoding set by default r.encoding = 'ISO-8859-1' #change encoding