def EncodedFile(file, data_encoding, file_encoding=None, errors='strict'):
 if (file_encoding is None):
  file_encoding = data_encoding
 data_info = lookup(data_encoding)
 file_info = lookup(file_encoding)
 sr = StreamRecoder(file, data_info.encode, data_info.decode, file_info.streamreader, file_info.streamwriter, errors)
 sr.data_encoding = data_encoding
 sr.file_encoding = file_encoding
 return sr

def EncodedFile ( file , data_encoding , file_encoding = None , errors = 'strict' ) : if ( file_encoding is None ) : file_encoding = data_encoding data_info = lookup ( data_encoding ) file_info = lookup ( file_encoding ) sr = StreamRecoder ( file , data_info . encode , data_info . decode , file_info . streamreader , file_info . streamwriter , errors ) sr . data_encoding = data_encoding sr . file_encoding = file_encoding return sr
return a wrapped version of file which provides transparent encoding translation .