test only encode