In C++, I want to use Unicode to do things. So after falling down the rabbit hole of Unicode, I\'ve managed to end up in a train wreck of confusion, headaches and locales.>
std::cout.imbue(convLoc);
std::cout << data << std::endl;
This does no conversion, since it uses . The only standard streams that use codecvt are file-streams. std::cout is not required to perform any conversion at all.codecvt which is a no-op
To force Boost.Filesystem to interpret narrow-strings as UTF-8 on windows, use boost::filesystem::imbue with a locale with a UTF-8 ↔ UTF-16 codecvt facet. Boost.Locale has an implementation of the latter.