encode script