fixed interface of open_file wrapper to also accept a file encoding