handle encoding.