lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Oct 4, 2011 at 5:42 PM, Petite Abeille <petite.abeille@gmail.com> wrote:
>
> On Oct 4, 2011, at 11:32 PM, Geoff Leyland wrote:
>
>>> Does anyone have a handy function to unquote a string.format %q transformation? I.e. reverse all the quoting performed by %q to revert to the original string, before quoting?
>>
>>
>> print(loadstring("return "..("%q"):format("here's a string"))())  ?
>
> Yes, that's a possibility. Unfortunately, as the string content is of unknown nature, simply executing it would be a bit reckless :)

How is it reckless when the manual explicitly says it's safe?

-- 
- Patrick Donnelly