Replace invalid characters in the input that cause the script to fail

I've found that exceptions generated by KVO problems in my unit tests sometimes create non-ASCII characters.

OCUnit2JUnit does not handle these gracefully and simply fails with a Ruby exception.

This patch prevents the script from failing when it encounters non-ASCII characters by converting them to UTF-8.