for test encode