Fix umlauts/special character issue in lua gettext
authorBlockMen <nmuelll@web.de>
Sun, 18 Aug 2013 21:30:30 +0000 (23:30 +0200)
committerPilzAdam <pilzadam@minetest.net>
Mon, 19 Aug 2013 20:23:41 +0000 (22:23 +0200)
src/script/lua_api/l_mainmenu.cpp

index 6417d1e183b15986ec4daa9b932372f0bafefd85..55376690eda01c68e6a0acd845cf6e5eaa1c9ddb 100644 (file)
@@ -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;
 }