[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is it possible to add utf-8 lua source file support in lua 5.2?
- From: J.Jørgen von Bargen <jjvb.primus@...>
- Date: Tue, 28 Sep 2010 04:56:55 +0000 (UTC)
Tom N Harris <telliamed <at> whoopdedo.org> writes:
> function utf8_dofile(filename)
> return assert(load(
> function()
> return string.gsub(
> assert(io.open(filename)):read('*a'),
> '^\239\187\191', '')
> end,
> filename
> ))()
> end
Which will close the file at some unspecified time in the not-so-near future and
may lead to "Out of file handles", if called often with no GC betweeen.