On 24 Mar 2022, at 18:50, Egor Skriptunoff wrote:
On Thu, Mar 24, 2022 at 4:51 PM Thijs Schreijer wrote:
This means that reading a Windows based text file, with CRLF as
line endings, the returned lines will have a trailing CR (char 13).
I can not reproduce this problem.
Everything works as expected on Windows.Here’s my test code:localCR=string.char(13) localLF=string.char(10) localfunctionwritefile(name,content) localf=io.open(name,"w") f:write(content) f:close() end locallines={--"*L"result: "1234567890"..LF,--1line,11bytes "1234567890"..LF..CR..LF,--2lines,11bytes+2bytes "1234567890"..CR..LF,--1line,12bytes "1234567890"..CR..LF..LF,--2lines,12bytes+1byte "1234567890"--1line,10bytes } lines=table.concat(lines) writefile("test.txt",lines)