diff options
Diffstat (limited to 'plugins/ut99/ut99.cpp')
-rw-r--r-- | plugins/ut99/ut99.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/plugins/ut99/ut99.cpp b/plugins/ut99/ut99.cpp index 827ff9310..9b5a11a00 100644 --- a/plugins/ut99/ut99.cpp +++ b/plugins/ut99/ut99.cpp @@ -35,20 +35,12 @@ */ #include "../mumble_plugin_main.h" +#include "../mumble_plugin_utils.h" procptr_t posptr; procptr_t frtptr; procptr_t topptr; -static void wcsToMultibyteStdString(wchar_t *wcs, std::string &str) { - const int size = WideCharToMultiByte(CP_UTF8, 0, wcs, -1, NULL, 0, NULL, NULL); - if (size == 0) return; - - str.resize(size); - - WideCharToMultiByte(CP_UTF8, 0, wcs, -1, &str[0], size, NULL, NULL); -} - static bool cross(float *a, float *b, float *c) { if (a == 0 || b == 0 || c == 0) return false; @@ -161,8 +153,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa wservername[sizeof(wservername)/sizeof(wservername[0]) - 1] = '\0'; - std::string servername; - wcsToMultibyteStdString(wservername, servername); + const std::string servername = utf16ToUtf8(wservername); std::ostringstream contextss; contextss << "{" |