[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Patching Lua to handle different code pages
- From: David Crayford <dcrayford@...>
- Date: Sat, 22 Mar 2014 00:17:42 +0800
On 22/03/2014 12:13 AM, Dirk Laurie wrote:
2014-03-21 18:05 GMT+02:00 David Crayford <firstname.lastname@example.org>:
I have a requirement to patch the Lua core to handle different code pages.
The code pages will mainly be EBCDIC but could be ASCII.
I've had a look at the code and it seems that I can hook iconv() calls into
luaL_loadfile, LuaL_loadbuffer and LuaL_loadstring in lauxlib.c, which
should translate all the source code before it hits the lexer/parser.
Is there a better way of doing it?
Needs to be done at runtime. Something like:
lua -encoding=ibm-037 <script>