def clean_title(title):
    """Remove/replace invalid characters from a string"""
    title = title.replace('&', '&amp;')
    title = title.replace('<', '&lt;')
    title = title.replace('>', '&gt;')
    title = title.replace('\x7f', '')
    return title
