def getenv(environ, key, default=None):
    """
    Return the named ``key`` from the WSGI environ dict ``environ`` as
    a byte string.
    """
    try:
        return environ[key].encode('ISO-8859-1')
    except KeyError:
        return default
