in liolib.c line 291 (version 2.1.3)
it use "fgets(p, LUAL_BUFFERSIZE, f)" to read the file (line 297)
but use "l = strlen(p);" to get the length (line 301)
so,for u file,although u read lots of bytes from file(eg n),the strlen will return 3 for your data "FF EE 58 00 30 00...."
and the length of this read will be set 3,so u will get 3 in lua script
but for ther file,the pos goes n bytes,so n-3 bytes lost,and at last u will get only few characters.
maybe it`s a bug of lua?
2008/10/8 Matthew Wild <firstname.lastname@example.org>
It's a hack, and there is probably a nice(r) way of doing it, but try:
On Wed, Oct 8, 2008 at 12:30 PM, Brian Sanders <email@example.com
> Hmm... so if it is in either UTF-16 or UCS-2 with BOM... is there any way
> for me to use these log files with a LUA script? I guess it is good to know
> that I did understand the LUA tutorials, it was my input file I was not
> looking closely enough at.
logstring = logstring:sub(3):gsub("%z", "")
It will at least remove the zeros that stop it from printing, but if
you have non-latin characters then they might get messed up.