See:
- https://discourse.phabricator-community.org/t/arc-diff-throws-runtime-exception-mb-check-encoding-on-windows/3819/
- https://bugs.php.net/bug.php?id=78609
If mb_check_encoding() is passed an object which is not a string, but implements __toString(), it raises a warning in certain versions of PHP:
We can avoid this by using phutil_string_cast() before passing the parameter.