lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On 22/03/2014 12:13 AM, Dirk Laurie wrote:
2014-03-21 18:05 GMT+02:00 David Crayford <dcrayford@gmail.com>:

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?
Customize lctype.c?

Needs to be done at runtime. Something like:

 lua -encoding=ibm-037 <script>