Why can't you take one of the solutions from the linked question and apply them to your situation? It seems like it'd be fairly simple to iterate over all the files you want to check, run iconv -f utf8
on them and emit a list of files where that fails.
Update
Since you haven't specified the situation or environment under which you need to do this test, it's hard to offer concrete advice. The post you linked offers methods of testing what you want, so it's just a matter of knowing what you have available to implement a solution.
Assuming a basic *nix envornment, this simple shell script provides a basic check, caveat the typical filename globbing issues.
#!/bin/sh
for f in *.xml; do
if ! iconv -f utf8 $f >/dev/null 2>&1; then
echo $f
fi
done
Unless you provide more information about your specific requirements though, it's difficult to know whether any answers people have is actually relevant.