[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Is it possible to add utf-8 lua source file support in lua 5.2?
- From: Robert Raschke <rtrlists@...>
- Date: Mon, 27 Sep 2010 15:07:21 +0100
2010/9/27 J.Jørgen von Bargen <email@example.com>
Robert Raschke <rtrlists <at> googlemail.com> writes:
>+ /* wasn't the UTF8 BOM, so reset everything again */
>+ fclose(lf.f);I doubt, this will not work on pipes. (characters are lost?)
>+ lf.f = fopen(filename, "r"); /* reopen */
Indeed, if you want to strip a UTF-8 BOM from a pipe stream you need to do something else. Essentially, you'd need to add in a read ahead buffer. That's a bit more work than the 10 extra lines for ditching a file BOM.
I haven't looked in detail, but do pipe opens even go via luaL_loadfile() ?