Created
December 29, 2012 03:25
-
-
Save Alir3z4/4404346 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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