eristoddle
4/3/2013 - 5:20 PM

Python Fuck Unicode Function

Python Fuck Unicode Function

def clean_bad_chars(strtoclean):
    if strtoclean != None:
        strcleaned = ''.join([x for x in strtoclean if ord(x) < 128])
        return strcleaned.strip()
    else:
        return ""