import re


def filter_content(content):
    """Filter content to make sure it can be built into json object
    """
    filtered_content = re.sub(r'[^\x00-\x7f]', r' ', content.strip("'").
                              replace("\n", "\\n").
                              replace("\r", "").
                              replace("\"", "'"))

    return filtered_content