import re


def decode_bytes(data: bytearray) -> str:
    """
    Decodes a bytes array from a file upload

    :param data: a UTF-8 encoded byte array
    :return: a cleaned string
    """
    pattern = re.compile('\r', re.UNICODE)
    res = data.decode('utf-8', 'ignore')
    res = pattern.sub('', res)
    return res