def clean_utf8(s):
    """
    aiohttp uses surrogatescape all over the header processing.
    try to stop it from leaking any farther.
    """
    try:
        s.encode()
    except UnicodeEncodeError:
        s = s.encode('utf-8', 'replace').decode()
    return s
