Fix more unicode issues in diff parsing.

A bug came in about parsing hg diffs with unicode characters, which prompted me
to audit all of our scmtools. There were a bunch of issues lurking, most of
which were exposed when I added unit tests.

Testing done: Ran unit tests.

Fixes bug 3261.

Reviewed at https://reviews.reviewboard.org/r/5540/