3

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'

Non
  • 1,936
  • 2
  • 17
  • 24

3 Answers3

4

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

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
4

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.

Fred Foo
  • 355,277
  • 75
  • 744
  • 836
0

Looks like URL encoding

jdehaan
  • 19,700
  • 6
  • 57
  • 97