encode script.