I need to convert between wstring and string. I figured out, that using codecvt facet should do the trick, but it doesn\'t seem to work for utf-8 locale.
My idea is,
The Lexertl library has an iterator that lets you do this:
std::string str; str.assign( lexertl::basic_utf8_out_iterator(wstr.begin()), lexertl::basic_utf8_out_iterator(wstr.end()));