def remove_unsafe_chars ( text ) : if isinstance ( text , six . string_types ) : text = UNSAFE_RE . sub ( '' , text ) return text
clean foreign language characters python text
Remove unsafe unicode characters from a piece of text .
def remove_unsafe_chars(text):
    """Remove unsafe unicode characters from a piece of text."""
    if isinstance(text, six.string_types):
        text = UNSAFE_RE.sub('', text)
    return text