
Why doesn't this simple code from the Boost.Locale docs work? #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> #include <boost/locale.hpp> #include <exception> #include <iostream> int main() { try { std::locale::global(boost::locale::generator().generate("")); boost::filesystem::path::imbue(std::locale()); boost::filesystem::ofstream hello("привет.txt"); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } return 0; } Compiled with
cl /EHsc /D _UNICODE /D UNICODE b.cpp /I%BOOST_ROOT% /MD /link /LIBPATH:%BOOST_ROOT%\stage\lib
it gives me
b.exe boost::filesystem::path codecvt to wstring: error
Could someone please explain what's the problem there and how do I handle Unicode file names on Windows using Boost.Filesystem & Boost.Locale? I'm using Boost 1.55.0 & compiling with MS Visual C++ 2010 compiler v.16.00.30319.01.