SetupEnvironment() - clean commit

Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 5248ff4
This commit is contained in:
Stuart Cardall
2014-05-13 10:15:00 +00:00
committed by Wladimir J. van der Laan
parent 4b8a3ab877
commit 337459b96b
5 changed files with 23 additions and 0 deletions

View File

@@ -1427,3 +1427,19 @@ void RenameThread(const char* name)
#endif
}
void SetupEnvironment()
{
#ifndef WIN32
try
{
#if BOOST_FILESYSTEM_VERSION == 3
boost::filesystem::path::codecvt(); // Raises runtime error if current locale is invalid
#else // boost filesystem v2
std::locale(); // Raises runtime error if current locale is invalid
#endif
} catch(std::runtime_error &e)
{
setenv("LC_ALL", "C", 1); // Force C locale
}
#endif
}