1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Refactor utf8_to_wide/wide_to_utf8 functions

This commit is contained in:
sfan5 2021-01-29 13:09:17 +01:00
parent 7ebd5da9cd
commit 5e392cf34f
3 changed files with 40 additions and 38 deletions

View file

@ -64,11 +64,13 @@ 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
// Try to avoid converting between wide and UTF-8 unless 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);
// You must free the returned string!
// The returned string is allocated using new[]
wchar_t *utf8_to_wide_c(const char *str);
// NEVER use those two functions unless you have a VERY GOOD reason to