'How to decode the wrong encoded "b'\\xc3\\xb1'" on Python 3.10
How can I output the incoming name data as a regular string? My code is here.
playerName = u''.join((name)).encode('utf-8').strip()
the output of this line
I\xc3\xb1aki Williams
must be Iñaki Williams
Solution 1:[1]
This code prints "IƱaki Williams"
name = "I\xc3\xb1aki Williams"
name = name.encode('latin')
name = name.decode()
print(name)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mario Rugeles Perez |
