diff --git a/src/util/util_string.cpp b/src/util/util_string.cpp index 8e1eb0c7..c684ca0d 100644 --- a/src/util/util_string.cpp +++ b/src/util/util_string.cpp @@ -22,4 +22,20 @@ namespace dxvk::str { &result.at(0), len, nullptr, nullptr); return result; } + + + std::vector tows(const std::string& str) { + int strLen = ::MultiByteToWideChar( + CP_ACP, 0, str.c_str(), str.length() + 1, + nullptr, 0); + + std::vector wideStr(strLen); + + ::MultiByteToWideChar( + CP_ACP, 0, str.c_str(), str.length() + 1, + wideStr.data(), strLen); + + return wideStr; + } + } diff --git a/src/util/util_string.h b/src/util/util_string.h index 3a176a35..36807e12 100644 --- a/src/util/util_string.h +++ b/src/util/util_string.h @@ -2,12 +2,15 @@ #include #include +#include #include "./com/com_include.h" namespace dxvk::str { std::string fromws(const WCHAR *ws); + + std::vector tows(const std::string& str); inline void format1(std::stringstream&) { }