1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Remove wstrgettext

Everywhere where wstrgettext was used, its output was converted back
to utf8. As wstrgettext internally converts the return value
from utf8 to wstring, it has been a waste. Remove the function, and
use strgettext instead.
This commit is contained in:
est31 2015-10-18 02:29:06 +02:00
parent f3d82567c9
commit 6b0cae5a9d
3 changed files with 34 additions and 42 deletions

View file

@ -1059,8 +1059,8 @@ int ModApiMainMenu::l_get_video_modes(lua_State *L)
/******************************************************************************/
int ModApiMainMenu::l_gettext(lua_State *L)
{
std::wstring wtext = wstrgettext((std::string) luaL_checkstring(L, 1));
lua_pushstring(L, wide_to_utf8(wtext).c_str());
std::string text = strgettext(std::string(luaL_checkstring(L, 1)));
lua_pushstring(L, text.c_str());
return 1;
}