[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: embedding zeroes
- From: Rebel Neurofog <rebelneurofog@...>
- Date: Tue, 20 Dec 2011 03:27:45 +0300
On Tue, Dec 20, 2011 at 2:37 AM, Patrick Rapin <firstname.lastname@example.org> wrote:
>>> output:write (string.format ("bootstrap_image = [=[%s]=]", binary))
>> It doesn't work at least due to newline mangling.
> So I suppose your system is Windows.
No. It isn't. More of that: in my case the code never gets to file
where it executed.
Lua 5.2 manual explicitly describes it:
`Any kind of end-of-line sequence (carriage return, newline, carriage
return followed by newline, or newline followed by carriage return) is
converted to a simple newline.`
> BTW Lua 5.2.0 has a better escaping scheme: all control characters are
> turned to \nnn form, with the leading zeros only inserted when
Yeah, I've noticed that. So I decided to avoid using %q and escaping
only ", \, CR and NL by hands.