Answers for "std string to wstring"

C++
1

std string to wstring

#include <locale>
#include <codecvt>
#include <string>

std::string str;
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::wstring wstr(converter.from_bytes(str));
Posted by: Guest on July-29-2021

Browse Popular Code Answers by Language