#include <string>
#include <locale>
#include <codecvt>
#include <iostream>
#include <iomanip>

using namespace std;
 
int main() 
{
        std::string str("\x61\x61\x61\xf0\x9f\x98\xa8\xe4\xb8\xad\xe6\x96\x87");
 
        std::wstring_convert<std::codecvt_utf8<wchar_t> > cvt_utf8;
        std::wstring ws = cvt_utf8.from_bytes(str);
 
        wcout << L"size of wchar_t == " << sizeof(wchar_t) << endl;
        wcout << L"ws.len == " << ws.length() << endl;
        wcout << L"ws: " << ws << endl;
        
        for (int i = 0; i < ws.length(); i++)
        {
            wcout << L"0x" << hex << (int)ws[i] << L" ";
        }
}