Get the diff in the proper encoding