import unicodedata


def normalize_errors(exception):
    """ Use unicode normalization to replace unencodable characters by there normalized form
    :param exception: a UnicodeEncodeError instance, which contains information about the location of the error
    :return: tuple with a replacement for the unencodable part of the input and a position where encoding should
    continue
    """
    data = exception.object[exception.start:exception.end]
    normalized = unicodedata.normalize('NFKD', data)
    replacement = b''.join([c.encode(exception.encoding, errors='ignore') for c in normalized])
    return replacement, exception.end