Added encoding_file function for ruby plugin