mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Ensure the script is Unicode before parsing.
This commit is contained in:
parent
31b7048fc9
commit
56f40a9c76
1 changed files with 8 additions and 0 deletions
|
@ -2232,7 +2232,15 @@ list lazy_list_set(list L, integer i, list v)
|
|||
|
||||
This function also builds the temporary globals table.
|
||||
"""
|
||||
|
||||
self.script = script
|
||||
if type(script) is not unicode:
|
||||
try:
|
||||
self.script = script.decode('utf8')
|
||||
except UnicodeDecodeError as E:
|
||||
self.errorpos = E.start
|
||||
raise EParse(self, 'Invalid UTF-8 in script')
|
||||
|
||||
self.length = len(script)
|
||||
|
||||
# Extended expressions in globals (needs support from the optimizer to work)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue