def decode_params_utf8(params):
 decoded = []
 for (k, v) in params:
  decoded.append(((k.decode('utf-8') if isinstance(k, str) else k), (v.decode('utf-8') if isinstance(v, str) else v)))
 return decoded

def decode_params_utf8 ( params ) : decoded = [ ] for ( k , v ) in params : decoded . append ( ( ( k . decode ( 'utf-8' ) if isinstance ( k , str ) else k ) , ( v . decode ( 'utf-8' ) if isinstance ( v , str ) else v ) ) ) return decoded
ensures that all parameters in a list of 2-element tuples are decoded to unicode using utf-8 .