import re


def normalize_whitespace(s):
    """
    Strips the string and replace all whitespace sequences and other non-printable characters with a single space.
    """
    assert isinstance(s, str)
    return re.sub(r'[\x00-\x20\s]+', ' ', s.strip())