1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 16:15:20 +02:00

GUIHyperText: Fix bug with UTF8 chars in action name + simplify UTF8 stringw conversion (#9437)

Co-authored-by: Pierre-Yves Rollo <dev@pyrollo.com>
This commit is contained in:
Jean-Patrick Guerrero
2020-03-07 14:01:11 +01:00
committed by GitHub
parent ce8cdc0333
commit 0e88176db8
3 changed files with 22 additions and 39 deletions

View File

@@ -726,11 +726,19 @@ inline std::string str_join(const std::vector<std::string> &list,
}
/**
* Create a std::string from a irr::core::stringw.
* Create a UTF8 std::string from a irr::core::stringw.
*/
std::string strwtostr(const irr::core::stringw &str);
inline std::string stringw_to_utf8(const irr::core::stringw &input)
{
std::wstring str(input.c_str());
return wide_to_utf8(str);
}
/**
* Create a irr::core:stringw from a std::string.
*/
irr::core::stringw strtostrw(const std::string &str);
/**
* Create a irr::core:stringw from a UTF8 std::string.
*/
inline irr::core::stringw utf8_to_stringw(const std::string &input)
{
std::wstring str = utf8_to_wide(input);
return irr::core::stringw(str.c_str());
}