diff --git a/simgear/misc/strutils.cxx b/simgear/misc/strutils.cxx index 48d8fea8..9fbcaf76 100644 --- a/simgear/misc/strutils.cxx +++ b/simgear/misc/strutils.cxx @@ -26,6 +26,7 @@ #include #include // strerror_r() and strerror_s() #include +#include // new in C++11 #include "strutils.hxx" @@ -401,6 +402,8 @@ std::wstring convertUtf8ToWString(const std::string& a) #ifdef SG_WINDOWS return convertMultiByteToWString(CP_UTF8, a); #else + std::wstring_convert, wchar_t> ucs2conv; + return ucs2conv.from_bytes(a); #endif } @@ -409,7 +412,8 @@ std::string convertWStringToUtf8(const std::wstring& w) #ifdef SG_WINDOWS return convertWStringToMultiByte(CP_UTF8, w); #else - + std::wstring_convert, wchar_t> ucs2conv; + return ucs2conv.to_bytes(w); #endif }