lua-users home
lua-l archive

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

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?