Support specifying an encoder; default to None