encode sample data