Ich versuche, diese Art von URL wie folgt http://example.com/?param=%DD%CC%C0-15
mit requests
Python-Erweiterung zu bekommen:Python (Requests) Codierung Probleme (UTF-8 - CP1251)
group = "ЭМА-15".encode('cp1251')
r = requests.get('http://example.com/?param=' + group)
r.encoding = "cp1251"
(weil Website arbeitet mit Windows-1251 (CP1251) Kodierung)
Und bekommen errorat Zeile 2: UnicodeDecodeError: 'utf8' codec can't decode byte 0xdd in position 82: invalid continuation byte
Aber diese Sequenz von Bytes (0xDD (% DD) ...) ist genau das, was ich brauche. Wie kann ich das beheben?
Bitte haben eine meine Antwort suchen. –