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 @@ -726,18 +726,20 @@ void RenameThread(const char* name)
726
726
727
727
void SetupEnvironment ()
728
728
{
729
- std::locale loc (" C" );
730
729
// On most POSIX systems (e.g. Linux, but not BSD) the environment's locale
731
730
// may be invalid, in which case the "C" locale is used as fallback.
732
731
#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
733
732
try {
734
- loc = std::locale (" " ); // Raises a runtime error if current locale is invalid
733
+ std::locale (" " ); // Raises a runtime error if current locale is invalid
735
734
} catch (const std::runtime_error&) {
736
735
setenv (" LC_ALL" , " C" , 1 );
737
736
}
738
737
#endif
739
- // The path locale is lazy initialized and to avoid deinitialization errors
738
+ // The path locale is lazy initialized and to avoid deinitialization errors
740
739
// in multithreading environments, it is set explicitly by the main thread.
740
+ // A dummy locale is used to extract the internal default locale, used by
741
+ // boost::filesystem::path, which is then used to explicitly imbue the path.
742
+ std::locale loc = boost::filesystem::path::imbue (std::locale::classic ());
741
743
boost::filesystem::path::imbue (loc);
742
744
}
743
745
You can’t perform that action at this time.
0 commit comments