Test the encoder