Fix encoding handling of filenames passed via command line arguments.