Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

string to wstring

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

std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::string narrow = converter.to_bytes(wide_utf16_source_string);
std::wstring wide = converter.from_bytes(narrow_utf8_source_string);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #string #wstring
ADD COMMENT
Topic
Name
3+1 =