This seems very specific. If the data is invalid utf8 then the script has to guess what the problem is, which is highly dependent on the process that created the data in the first place.
Is the data in a different encoding? Does the script use Encode::Guess? What does it do exactly?
My first reaction would be that such a script could be quite dangerous, giving users the impression that they can just run it and have all their problems disappear, when I believe that cleaning up encodings is actually a task that is very difficult to automate in general. At the very least it should come with a huge warning and a long definition of the exact scope of the cleanup it performs