check params for encode