Skip to content

Instantly share code, notes, and snippets.

@Alir3z4
Created December 29, 2012 03:25
Show Gist options
  • Save Alir3z4/4404346 to your computer and use it in GitHub Desktop.
Save Alir3z4/4404346 to your computer and use it in GitHub Desktop.
def utf8ify(value):
if not value: return
# remove some characters altogether
value = re.sub(r'[?.,;/:"\'\|!@#~`+=$%^&\\*()\[\]{}<>]','',value, re.UNICODE)
return value
def utf8ify_slugify(value):
value = utf8ify(value)
value = value.replace(" ", "-")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment