import unicodedata


def strip_unicode(str):
    """Replace unicode characters with ascii characters (e.g., replace é with e)."""
    # Documentation for normalize function:
    # https://docs.python.org/3/library/unicodedata.html#unicodedata.normalize
    # Basically, (from what I understand) this splits the characters with accent
    # marks, etc. (e.g. é) into two parts: the latin character (e.g. e) and a
    # special "combining" character that represents the accent. The string is then
    # encoded into ascii with the 'ignore' option, so it ignores characters that
    # cannot be represented in ascii, thus removing the special combining characters
    # but leaving behind the regular ones. The resulting binary is then decoded back
    # into utf-8.
    return (unicodedata.normalize('NFD', str)
            .encode('ascii', 'ignore')
            .decode('utf-8'))