dil: added another encode() functions.