I trying to get this kind of URL http://example.com/?param=%DD%CC%C0-15
with requests
python extension like this:
group = "ЭМА-15".encode('cp1251')
r = requests.get('http://example.com/?param=' + group)
r.encoding = "cp1251"
(because site works with windows-1251 (cp1251) encoding)
And getting errorat line 2: UnicodeDecodeError: 'utf8' codec can't decode byte 0xdd in position 82: invalid continuation byte
But this sequence of bytes (0xDD (%DD)...) is exactly what I need.
How can I fix that?