forked from qt-creator/qt-creator
cdbext: fix c++17 deprecation warning
Change-Id: I2d06f602b4b229d1dec1dc1924e473f6b7aa4f68 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -36,6 +36,8 @@
|
||||
#include <codecvt>
|
||||
#include <iomanip>
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
static const char whiteSpace[] = " \t\r\n";
|
||||
|
||||
void trimFront(std::string &s)
|
||||
@@ -152,7 +154,10 @@ std::string wStringToString(const std::wstring &w)
|
||||
|
||||
std::wstring utf8ToUtf16(const std::string &s)
|
||||
{
|
||||
return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>>().from_bytes(s.data());
|
||||
const int size = MultiByteToWideChar(CP_UTF8, 0, s.data(), int(s.size()), NULL, 0);
|
||||
std::wstring result(size, 0);
|
||||
MultiByteToWideChar(CP_UTF8, 0, s.data(), int(s.size()), result.data(), size);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Convert an ASCII hex digit to its value 'A'->10
|
||||
|
Reference in New Issue
Block a user