fix diff rendering

issue #26
use constants for encoding