Encode filenames to allow for spaces in names.