Reputation: 2006
does anybody know in which way the string 'Krummh%C3%B6rn' is encoded?
Plain text is "Krummhörn".
I need to decode strings like this one in Python and tried urllib.unquote('Krummh%C3%B6rn') The result: 'Krummh\xc3\xb6rn'
Upvotes: 3
Views: 322
Reputation: 363767
That's UTF-8 in URL encoding.
print(urllib.unquote('Krummh%C3%B6rn').decode('utf-8'))
prints the string as you'd expect it to look.
Upvotes: 4
Reputation: 799170
You're halfway there. Take that result and decode it as UTF-8.
Upvotes: 4