diff options
author | est31 <MTest31@outlook.com> | 2015-06-10 00:35:21 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-06-13 19:49:55 +0200 |
commit | 572990dcd3f43386860b5b14015ad722fb96ea83 (patch) | |
tree | f1f1f57b612aec58e226bf43ad1e2a78441cdc4f /src/util/string.h | |
parent | aa13baa30a45b0f834c23bd5c0407895eb8ec0ee (diff) | |
download | minetest-572990dcd3f43386860b5b14015ad722fb96ea83.tar.gz minetest-572990dcd3f43386860b5b14015ad722fb96ea83.tar.bz2 minetest-572990dcd3f43386860b5b14015ad722fb96ea83.zip |
Add utf-8 conversion utilities and re-add intlGUIEditBox
Diffstat (limited to 'src/util/string.h')
-rw-r--r-- | src/util/string.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/util/string.h b/src/util/string.h index b80e3c9a8..5bf2b5b7c 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -39,10 +39,18 @@ struct FlagDesc { u32 flag; }; +// try not to convert between wide/utf8 encodings; this can result in data loss +// try to only convert between them when you need to input/output stuff via Irrlicht +std::wstring utf8_to_wide(const std::string &input); +std::string wide_to_utf8(const std::wstring &input); + +// NEVER use those two functions unless you have a VERY GOOD reason to +// they just convert between wide and multibyte encoding +// multibyte encoding depends on current locale, this is no good, especially on Windows + // You must free the returned string! // The returned string is allocated using new wchar_t *narrow_to_wide_c(const char *str); - std::wstring narrow_to_wide(const std::string &mbs); std::string wide_to_narrow(const std::wstring &wcs); |