Introduce option for output encoding.
Integrate output encoding option.