Handle invalid UTF-8 characters in commit objects.