diff --git a/Library/lua/LuaManager.h b/Library/lua/LuaManager.h index 241f7187..b2eb3f13 100644 --- a/Library/lua/LuaManager.h +++ b/Library/lua/LuaManager.h @@ -34,6 +34,8 @@ public: static lua_State* GetState(bool unicode) { c_UnicodeState = unicode; return c_State; } + static bool IsUnicodeState() { return c_UnicodeState; } + static void ReportErrors(const std::wstring& file); static void PushWide(const WCHAR* str); diff --git a/Library/lua/glue/LuaGlobal.cpp b/Library/lua/glue/LuaGlobal.cpp index 414e4e9e..d6a61f1c 100644 --- a/Library/lua/glue/LuaGlobal.cpp +++ b/Library/lua/glue/LuaGlobal.cpp @@ -54,7 +54,8 @@ static int Print(lua_State* L) lua_pop(L, 1); } - LogDebug(StringUtil::Widen(message).c_str()); + LogDebug(LuaManager::IsUnicodeState() ? + StringUtil::WidenUTF8(message).c_str() : StringUtil::Widen(message).c_str()); return 0; }