For the following code, is it possible to output the result to a string instead of wofstream? Thanks you!
wstring w = L"test";
std::wofstream ofs("test.txt");
std::locale utf8_locale(std::locale(), new boost::archive::detail::utf8_codecvt_facet());
ofs.imbue(utf8_locale);
std::copy(w.begin(),w.end(),
std::ostream_iterator<wchar_t, wchar_t>(ofs));