mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-10 22:58:40 +02:00
SetupEnvironment() - clean commit
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 5248ff4
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
4b8a3ab877
commit
337459b96b
16
src/util.cpp
16
src/util.cpp
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user