Познакомимся с load
. Эта функция берёт первым аргументом строку и компилирует её.
local str = "Тест!"
print(load(str))
--> nil [string "Тест!"]:1: unexpected symbol near '<\208>'
Код выше вернёт странные идеограммы, но если присмотреться, то становится заметно, что именно там происходит.