Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mumble_plugin_utils.h')
-rw-r--r--plugins/mumble_plugin_utils.h8
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