
std::cout.imbue(std::locale()); // Now global locale imbued to stream as
well.
LOL, DUH! OK. Thanks.
Well join the club - I've fallen into this pit recently :-(
Am I correct in thinking that the reason is that std::cout is constructed *before* the new locale is 'globalled'?
Yes.
And so std::cerr needs imbuing too but that fstream and stringstreams constructed after the std::locale::global("en_US.UTF-8") statement will get the new locale?
Yes, basically if you want to do it fully for standard library and boost: std::locale::global(loc); std::cout.imbue(loc); std::cin.imbue(loc); std::cerr.imbue(loc); std::clog.imbue(loc); std::wcout.imbue(loc); std::wcin.imbue(loc); std::wcerr.imbue(loc); std::wclog.imbue(loc); // this is for boost filesystem boost::filesystem::path::imbue(loc);
Paul
Artyom