From 78ea818aaf398e5eec4f1da7c302d3082aaf7f3c Mon Sep 17 00:00:00 2001 From: BlockMen Date: Sun, 18 Aug 2013 23:30:30 +0200 Subject: [PATCH] Fix umlauts/special character issue in lua gettext --- src/script/lua_api/l_mainmenu.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index 6417d1e18..55376690e 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -979,9 +979,8 @@ int ModApiMainMenu::l_download_file(lua_State *L) /******************************************************************************/ int ModApiMainMenu::l_gettext(lua_State *L) { - const char* str = luaL_checkstring(L, 1); - str = gettext(str); - lua_pushstring(L, str); + std::wstring wtext = wstrgettext((std::string) luaL_checkstring(L, 1)); + lua_pushstring(L, wide_to_narrow(wtext).c_str()); return 1; } -- 2.25.1