I want to read / write a file with a unicode file name using boost filesystem, boost locale on Windows (mingw) (should be platform independent at the end).
This is my co
I don't know how the answer here got accepted, since OP does fs::path::imbue(std::locale());
precisely not to give a damn about OS's codepage, std::wstring
and what not. Otherwise yeah, he'd just use plain old iconv, Winapi calls or other things suggested in the accepted answer. But that is not the point of using boost::locale here.
The real answer why this doesn't work, even though OP does imbue()
current locale like instructed in the Boost's documentation (see "Default Encoding under Microsoft Windows"), is because of boost (or mingw) bugs that go unresolved for at least a couple of years as of March 2015.
Unfortunately, mingw users seem to be left out in the cold.
Now, what boost developers should do in order to cover for these bugs is a whole different matter. It might turn out they need to implement precisely what Dan has stated.