
17 Jun
2010
17 Jun
'10
6:52 p.m.
I thought some actual code might be of interest. Attached is a screenshot showing that the code worked as expected with VC++ 9.0. --Beman #include <boost/filesystem/fstream.hpp> #include <boost/filesystem/detail/utf8_codecvt_facet.hpp> #include <iostream> #define BOOST_FILESYSTEM_VERSION 3 int main() { // "שלום" is "hello" in Hebrew; thanks to Artyom for the example std::locale global_loc = std::locale(); std::locale loc(global_loc, new boost::filesystem::detail::utf8_codecvt_facet); std::locale old_loc = boost::filesystem::path::imbue(loc); boost::filesystem::ofstream f("שלום.narrow"); return 0; }