def is_ascii(text):
    """Return True if the text encodes as ascii."""
    try:
        text.encode('ascii')
        return True
    except Exception:
        pass
    return False
Return True if the text encodes as ascii.
cherrypy/test/test_http.py