def downgrade_wsgi_ux_to_1x(environ):
    """Return new environ dict for WSGI 1.x from provided WSGI u.x environ."""
    env1x = {}

    url_encoding = environ[ntou('wsgi.url_encoding')]
    for k, v in environ.copy().items():
        if k in [ntou('PATH_INFO'), ntou('SCRIPT_NAME'), ntou('QUERY_STRING')]:
            v = v.encode(url_encoding)
        elif isinstance(v, str):
            v = v.encode('ISO-8859-1')
        env1x[k.encode('ISO-8859-1')] = v

    return env1x
Return new environ dict for WSGI 1.x from provided WSGI u.x environ.
cherrypy/_cpwsgi.py