encoding to test data