Don't crash when a file diff contains utf-8 chars

This fixes a crash when the client tries to render the diff of a file
which includes unicode characters. This change assumes that utf-8 is the
default encoding, which looking at the rest of the code appears to be a
safe bet.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>