lua-users home
lua-l archive

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


I am reading some ASCII print data which contains form control characters.
This is Win/XP, so the lines are delimited by X'0A0D'. My problem occurs
when I encounter a "form feed" (X'0C'). The code is like:

     local buffer = inpfile:read("*line")
     local slen = string.len(buffer)

The program raises an error on an input line of length 1 when buffer = 0x0C.
The actual data line is X'0C0A0D'. Is there some other way to get the length
that doesn't care about control characters or unprintables? I tried "assert"
to no avail.