Move the scriptencoding line to the top of the file