Would it make sense for this to be in `ReplaceInvalidChars`?