fix handling of special characters in filenames