Reputation: 2444
I'm trying to do this in Python: 'Fi\xc3\xb1a'.decode('utf-8')
I expect the result to be Fiña
. But the result is actually: u'Fi\xf1a'
No idea what is going on, some help on this would be much appreciated.
Thanks!
Upvotes: 1
Views: 317
Reputation: 308111
You're getting the correct result, the Unicode codepoint for ñ
is U+00f1. It's just that Python won't display the Unicode character directly. Try it in a print
statement and see what you get.
Upvotes: 5