Add support for encoding.