I run this file test.py
in my Sublime venv Python build system:
import re
text = "skull ☠️..."
print(text)
print(repr(text))
x = re.sub(r' *[\u2600-\u26FF]', r'', text)
print(x)
print(repr(x))
And see the output in Sublime window as expected:
skull ☠️...
'skull ☠️...'
skull️...
'skull️...'
But when I run the same file from command line in Windows 10 I get a strange question marks:
In Google Colab it also works as expected:
There is an invisible symbol with index 5:
What's happening here? How can I remove ☠️
without any question marks or zero width symbols on its place?