handle the encoding.