import unicodedata


def validate_data(data):
    """
    Simple Data Validation Function

    Strip new line characters and encode as ascii instead of unicode.

    If column is empty we put a space character to maintain the correct number
    of columns in the CSV file.
    """
    if data == '':
        return ' '

    elif (type(data) == int or type(data) == bool or type(data) == list):
        return data

    else:
        return unicodedata.normalize(
            'NFKD', data.rstrip('\r?\n|\r/')
        ).encode('ascii', 'ignore')