Boost logo

Boost :

Subject: [boost] [filesystem] path does not use global locale's codecvt facet - bug or feature
From: Artyom (artyomtnk_at_[hidden])
Date: 2011-03-03 08:31:33


Hello, Boost.Filesystem v3 uses wide path under windows and can convert it from the narrow one using codecvt facet, so I would expect if the global locale is some locale that has special codecvt facet installed boost.filesystem should use it, i.e.: int main() { boost::locale::generator locale_generator; std::locale::global(locale_generator("en_US.UTF-8")); // Now default codecvt facet is UTF-8 one. boost::filesystem::path p("שלום.txt"); boost::filesystem::ofstream test(p); } However this does not work as expected! I had found that you need to imbue locale explicitly: boost::filesystem::path p; p.imbue(std::locale()); // global one p = "שלום.txt"; boost::filesystem::ofstream test(p); Now it works. Should I open a ticket for this or this is "planned" behavior?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk