lua-users home
lua-l archive

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


On Tue, Dec 20, 2011 at 2:37 AM, Patrick Rapin <toupie300@gmail.com> 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
> necessary.

Yeah, I've noticed that. So I decided to avoid using %q and escaping
only ", \, CR and NL by hands.