add encode test for iOS