encoder: add object pretty printing