Create an encoder.