lua-users home
lua-l archive

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


Ico wrote:
I'm trying to use io.lines() to read lines from a file which contains \0
characters. This seems to fail, probably because of the fgets() used in
iolib.c:read_line().

Because - unlike C strings/char arrays - Lua strings are 8-bit safe, the
expected behaviour for me was for io.lines() to simply handle the \0's
as regular characters.

This behavior can be easily achieved, see
http://lua-users.org/lists/lua-l/2008-04/msg00266.html

--
Shmuel