import unicodedata


def normalize_casefold(text, *,
                       _casefold=str.casefold, _normalize=unicodedata.normalize
                       ):
    """Normalize text data for caseless comparison

    Use the "canonical caseless match" algorithm defined in the Unicode Standard,
    version 10.0, section 3.13, requirement D146 (page 159).
    """
    # Taken from https://stackoverflow.com/questions/319426/how-do-i-do-a-case-insensitive-string-comparison#comment60758553_29247821

    return _normalize('NFKD',
                      _casefold(_normalize('NFKD',
                                           _casefold(_normalize('NFD', text)))))