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:
parent
f3d82567c9
commit
6b0cae5a9d
3 changed files with 34 additions and 42 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue