support multiple encode algorithm