diff options
Diffstat (limited to 'plugins/MirLua/src/plugin.cpp')
-rw-r--r-- | plugins/MirLua/src/plugin.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/MirLua/src/plugin.cpp b/plugins/MirLua/src/plugin.cpp index bf2c47ced4..ceefe7d7b0 100644 --- a/plugins/MirLua/src/plugin.cpp +++ b/plugins/MirLua/src/plugin.cpp @@ -172,7 +172,9 @@ INT_PTR CMPlugin::Call(WPARAM wParam, LPARAM lParam) lua_pushcfunction(L, mlua_call); CMLuaEnvironment env(L); - wchar_t *result = env.Call(); + env.Call(); + wchar_t *result = mir_utf8decodeW(lua_tostring(L, -1)); + lua_pop(L, 1); env.Unload(); return (INT_PTR)result; @@ -183,7 +185,9 @@ INT_PTR CMPlugin::Eval(WPARAM, LPARAM lParam) const wchar_t *script = (const wchar_t*)lParam; CMLuaEnvironment env(L); - wchar_t *result = env.Eval(script); + env.Eval(script); + wchar_t *result = mir_utf8decodeW(lua_tostring(L, -1)); + lua_pop(L, 1); env.Unload(); return (INT_PTR)result; @@ -194,7 +198,9 @@ INT_PTR CMPlugin::Exec(WPARAM, LPARAM lParam) const wchar_t *path = (const wchar_t*)lParam; CMLuaEnvironment env(L); - wchar_t *result = env.Exec(path); + env.Exec(path); + wchar_t *result = mir_utf8decodeW(lua_tostring(L, -1)); + lua_pop(L, 1); env.Unload(); return (INT_PTR)result; |