aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBlockMen <nmuelll@web.de>2013-08-18 23:30:30 +0200
committerPilzAdam <pilzadam@minetest.net>2013-08-19 22:23:41 +0200
commit78ea818aaf398e5eec4f1da7c302d3082aaf7f3c (patch)
tree629f328d2451bcd15d98223dd800319b5bb6b215 /src
parentdeaa8dc2874871a4be1c706edbac6083c81d666b (diff)
downloadminetest-78ea818aaf398e5eec4f1da7c302d3082aaf7f3c.tar.gz
minetest-78ea818aaf398e5eec4f1da7c302d3082aaf7f3c.tar.bz2
minetest-78ea818aaf398e5eec4f1da7c302d3082aaf7f3c.zip
Fix umlauts/special character issue in lua gettext
Diffstat (limited to 'src')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp5
1 files 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;
}