Encode output