encode test