Skip to content

Instantly share code, notes, and snippets.

@sandeepthukral
Last active December 17, 2019 09:17
Show Gist options
  • Save sandeepthukral/e3a16e325ddfb46975f8 to your computer and use it in GitHub Desktop.
Save sandeepthukral/e3a16e325ddfb46975f8 to your computer and use it in GitHub Desktop.
python - remove annoying unicode characters
s = 'This is some \\u03c0 text that has to be cleaned\\u2026! it\\u0027s annoying!'
print(s.decode('unicode_escape').encode('ascii','ignore')) # This is some text that has to be cleaned! it's annoying!
@sandeepthukral
Copy link
Author

Thanks to Burhan Khalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment