Fix invalid utf8 character handling for commit objects.