This could cause a regression on diff that are not using utf-8 or ascii.
LGTM.
Committed as a83b34c14322.