diff options
Diffstat (limited to 'plugins/mumble_plugin_utils.h')
-rw-r--r-- | plugins/mumble_plugin_utils.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/mumble_plugin_utils.h b/plugins/mumble_plugin_utils.h index 0f7742f87..307dc76ff 100644 --- a/plugins/mumble_plugin_utils.h +++ b/plugins/mumble_plugin_utils.h @@ -6,6 +6,14 @@ #ifndef MUMBLE_MUMBLE_PLUGIN_UTILS_H_ #define MUMBLE_MUMBLE_PLUGIN_UTILS_H_ +#include <codecvt> +#include <locale> + +static inline std::string utf16ToUtf8(const std::wstring &wstr) { + std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> conv; + return conv.to_bytes(wstr); +} + // escape lossily converts the given // string to ASCII, replacing any // character not within the printable |