Fixed failure to convert to UTF-8 when loading scripts.