debug encode