I have a list with names. Some of them consists of strange chars like ★ or ™. When I am iterating threw list, it prints just fine:
★ StatTrak™ Huntsman Knife | Safari Mesh (Battle-Scarred)
Souvenir USP-S | Night Ops (Well-Worn)
StatTrak™ G3SG1 | The Executioner (Minimal Wear)
However, when I try to print it one by one:
print a[0]
'\xe2\x98\x85 StatTrak\xe2\x84\xa2 Huntsman Knife | Safari Mesh (Battle-Scarred)'
How to solve this problem?
UPDATE:
Iterating:
list = ['★ StatTrak™ Huntsman Knife | Safari Mesh (Battle-Scarred)',
'Souvenir USP-S | Night Ops (Well-Worn)',
'StatTrak™ G3SG1 | The Executioner (Minimal Wear)']
for name in list:
print name
>>>
★ StatTrak™ Huntsman Knife | Safari Mesh (Battle-Scarred)
Souvenir USP-S | Night Ops (Well-Worn)
StatTrak™ G3SG1 | The Executioner (Minimal Wear)
However:
list[0]
>>>
'StatTrak\xe2\x84\xa2 G3SG1 | The Executioner (Minimal Wear)'
list[0]it shows You the strings with codes for special symbols depending on the string coding, when You runprint list[0]it will exchange those codes with exact symbols.