def downgrade_wsgi_ux_to_1x(environ):
 env1x = {}
 url_encoding = environ[ntou('wsgi.url_encoding')]
 for (k, v) in list(environ.items()):
  if (k in [ntou('PATH_INFO'), ntou('SCRIPT_NAME'), ntou('QUERY_STRING')]):
   v = v.encode(url_encoding)
  elif isinstance(v, six.text_type):
   v = v.encode('ISO-8859-1')
  env1x[k.encode('ISO-8859-1')] = v
 return env1x

def downgrade_wsgi_ux_to_1x ( environ ) : env1x = { } url_encoding = environ [ ntou ( 'wsgi.url_encoding' ) ] for ( k , v ) in list ( environ . items ( ) ) : if ( k in [ ntou ( 'PATH_INFO' ) , ntou ( 'SCRIPT_NAME' ) , ntou ( 'QUERY_STRING' ) ] ) : v = v . encode ( url_encoding ) elif isinstance ( v , six . text_type ) : v = v . encode ( 'ISO-8859-1' ) env1x [ k . encode ( 'ISO-8859-1' ) ] = v return env1x
return a new environ dict for wsgi 1 .