Corrects invalid characters in filenames