luawinfile
luawinfile copied to clipboard
Is it possible to backport to support Lua 5.1?
The project I code for, the Mudlet MUD client, provides a lua sub-system for our users to extend it's functionality. We are working towards getting it properly I18n-ised and we are embracing Unicode by using the UTF-8 encoding to support it. However for one platform (Windows) the file handling for non-ASCII characters in file names is ~~really borked~~ not working with file and path names containing such characters.
I think luawinfile will enable us to properly sort it out but we are tied for the foreseeable future to lua 5.1 though I see in the makefile
that you want to compile luawinfile against 5.3 - is this a hard requirement or can it work with the older minor version?
Oh, it is not so simple, there are a few things that are used that are 5.3 features which I haven't yet got my head around and alternatives would have to be found for my intended usage with 5.1 :slightly_frowning_face: .
I have no plan to backport to lua 5.1, but I think you can do it on your fork.
Just remove luaL_checkversion
and replace lua_seti/lua_geti
to lua_rawseti/lua_rawgeti
, lua_setuservalue/lua_getuservalue
to lua_setfenv/lua_getfenv
to match lua 5.1 api.
If you have any trouble , leave a message here.
After seeing this message, out of curiosity, I tried compiling against Lua 5.1, and redefined the functions mentioned above based on lua-compat-5.3, but there were a lot more errors than that, so I gave up. Maybe actually using the c-api files from lua-compat-5.3 would work, but I am not very experienced with C and compiling.
see https://github.com/hlizard/luawinfile