Set input & output encoding.