lua-users home
lua-l archive

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


>> Again, it works fine for me but will it work everywhere? I couldn't
>> find an answer in manual or the list.
>
> >From the Lua part it should work everywhere, but I am not sure whether
> all file systems will be happy with embedded zeros inside text files.

That's good. Thanks!

>> > (Anyway note that, as Rapin pointed out, there may be more efficient
>> > ways to store your data.)
>>
>> How exactly?
>
> For instance, you may represent other "control" bytes as themselves, as
> you intended to do with \0. As long as Lua is concerned, any byte inside
> a double-quoted string that is different from escape '\', double quote
> '"', and new lines (both '\r' and '\n') is OK.  As with '\0', you just
> have to worry about the file system.
>
> -- Roberto
>

%q works the same way except for control characters and zero byte.

Anyway, I would add this to manual (both for strings parsing behavior)
for completeness.

Thanks, again!