File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -713,18 +713,20 @@ void RenameThread(const char* name)
713713
714714void SetupEnvironment ()
715715{
716- std::locale loc (" C" );
717716 // On most POSIX systems (e.g. Linux, but not BSD) the environment's locale
718717 // may be invalid, in which case the "C" locale is used as fallback.
719718#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
720719 try {
721- loc = std::locale (" " ); // Raises a runtime error if current locale is invalid
720+ std::locale (" " ); // Raises a runtime error if current locale is invalid
722721 } catch (const std::runtime_error&) {
723722 setenv (" LC_ALL" , " C" , 1 );
724723 }
725724#endif
726- // The path locale is lazy initialized and to avoid deinitialization errors
725+ // The path locale is lazy initialized and to avoid deinitialization errors
727726 // in multithreading environments, it is set explicitly by the main thread.
727+ // A dummy locale is used to extract the internal default locale, used by
728+ // boost::filesystem::path, which is then used to explicitly imbue the path.
729+ std::locale loc = boost::filesystem::path::imbue (std::locale::classic ());
728730 boost::filesystem::path::imbue (loc);
729731}
730732
You can’t perform that action at this time.
0 commit comments