[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: embedding zeroes
- From: Rebel Neurofog <rebelneurofog@...>
- Date: Mon, 19 Dec 2011 17:42:23 +0300
Hi, people of the list!
I'd like to ask whether this quotation improvement is guaranteed or
not to work in Lua:
output:write ((string.gsub (string.format ("bootstrap_image = %q",
binary), "\\000", "\0")))
-- Zero bytes are very common for binary formats so it's great to
reduce it's encoded length.
The manual says `Strings in Lua may contain any 8-bit value, including
embedded zeros, which can be specified as '\0'.`
But can it be specified as zero itself?
It works fine on my host, but is it guaranteed to work elsewhere?