encode dict entries.