[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: unescape lua string (opposite of %q)
- From: Pan Shi Zhu <pan.shizhu@...>
- Date: Tue, 8 Jun 2010 10:53:38 +0800
On Sat, Jun 5, 2010 at 1:02 PM, Graham Wakefield <email@example.com> wrote:
> Hmm, I must be slow. I can't figure out how to convert a string with represented control characters into a string with actual control characters.
> local input = [[ line 1\nline2 ]]
I think loadstring() may be the simplest solution.
you may need to use double quotes for the string, and you should quote
all double quotes inside the string . Using single quotes is the
Use [[ and ]] are not recommended, since it cannot be quoted and will
have security problem when used with loadstring().