Skip to content

Instantly share code, notes, and snippets.

@philippeowagner
Created January 19, 2015 15:37
Show Gist options
  • Select an option

  • Save philippeowagner/2f62929a9815c50a7080 to your computer and use it in GitHub Desktop.

Select an option

Save philippeowagner/2f62929a9815c50a7080 to your computer and use it in GitHub Desktop.
Replace non-ASCII chars with ?
# based on http://stackoverflow.com/a/20078869/485361
import re
re.sub(r'[^\x00-\x7F]+','?', "Müller")
# 'M?ller'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment