lua: run unicode-monkeypatch on Windows when loading scripts
This commit is contained in:
parent
8394f1adca
commit
51494a07d9
1 changed files with 8 additions and 0 deletions
|
@ -146,6 +146,14 @@ namespace agi { namespace lua {
|
||||||
lua_rawseti(L, -2, 2);
|
lua_rawseti(L, -2, 2);
|
||||||
lua_pop(L, 2); // loaders, package
|
lua_pop(L, 2); // loaders, package
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
// Replace the default lua IO functions with our unicode compatibile ones
|
||||||
|
luaL_loadstring(L, "require('unicode-monkeypatch')");
|
||||||
|
if (lua_pcall(L, 0, 0, 0)) {
|
||||||
|
return false; // leave error message
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
luaL_loadstring(L, "return require('moonscript').loadstring");
|
luaL_loadstring(L, "return require('moonscript').loadstring");
|
||||||
if (lua_pcall(L, 0, 1, 0)) {
|
if (lua_pcall(L, 0, 1, 0)) {
|
||||||
return false; // leave error message
|
return false; // leave error message
|
||||||
|
|
Loading…
Reference in a new issue