Non
Non

Reputation: 2006

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'

Upvotes: 3

Views: 322

Answers (3)

Fred Foo
Fred Foo

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

jdehaan
jdehaan

Reputation: 19938

Looks like URL encoding

Upvotes: 0

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799170

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

Upvotes: 4

Related Questions