Reputation: 4899
I have a string in Python 3.5:
In [2]: foo
Out[2]: 'Attila_Szedl%C3%A1k'
I would like to turn it to something like
In [3]: foo_mod
Out[3]: 'Attila_Szedlák'
That is, I want to turn the "á" character's utf-8 code to something that is actually an "á". What is the mapping from foo
to foo_mod
?
I have tried
In [4]: foo_mod = foo.encode("latin-1")
In [5]: foo_mod
Out[5]: b'Attila_Szedl%C3%A1k'
But this is apparently not what I want.
Upvotes: 1
Views: 132