[lit] Support parsing scripts with inconsistent or invalid encodings.