string to wstring

Solutions on MaxInterview for string to wstring by the best coders in the world

showing results for - "string to wstring"
Salma
01 May 2016
1#include <locale>
2#include <codecvt>
3#include <string>
4
5std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
6std::string narrow = converter.to_bytes(wide_utf16_source_string);
7std::wstring wide = converter.from_bytes(narrow_utf8_source_string);
8