manage encoding