Fix encoding in tests