[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: NUL byte in string literal
- From: Matthew Wild <mwild1@...>
- Date: Mon, 2 Apr 2018 10:24:43 +0100
Hey,
Just a bit of feedback that I'm surprised hasn't come up before, but I
couldn't find it in the archives.
I feel the manual is a bit misleading when it says the following:
> Strings in Lua can contain any 8-bit value, including embedded zeros, which can be specified as '\0'.
While this is correct in most cases, it's not technically accurate
that you can actually always use \0. If it is followed by numeric
digits, they will instead be interpreted instead as a numeric escape
sequence.
That leaves the only truly correct way of representing \0 (that
doesn't depend on context) as \000.
Regards,
Matthew