`encoding` seems a confusing variable name here... Maybe `file_format`?