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

using namespace std;

int main(int argc, wchar_t* argv[])
{
	std::string str("\x61\x61\x61\xf0\x9f\x98\xa8\xe4\xb8\xad\xe6\x96\x87");

	std::wstring_convert<std::codecvt_utf8_utf16<wchar_t> > cvt_utf8;
	auto 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" ";
	}

	return 0;
}