Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which encoding?

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'

like image 874
Non Avatar asked Jan 25 '26 08:01

Non


2 Answers

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.

like image 71
Fred Foo Avatar answered Jan 26 '26 20:01

Fred Foo


You're halfway there. Take that result and decode it as UTF-8.

like image 32
Ignacio Vazquez-Abrams Avatar answered Jan 26 '26 20:01

Ignacio Vazquez-Abrams