From: BlockMen Date: Sun, 18 Aug 2013 21:30:30 +0000 (+0200) Subject: Fix umlauts/special character issue in lua gettext X-Git-Tag: 0.4.8~203 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=78ea818aaf398e5eec4f1da7c302d3082aaf7f3c;p=oweals%2Fminetest.git Fix umlauts/special character issue in lua gettext --- 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; }