aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorStuart Cardall <developer@it-offshore.co.uk>2014-05-13 10:15:00 +0000
committerWladimir J. van der Laan <laanwj@gmail.com>2014-05-19 15:16:33 +0200
commit337459b96b4fb270db0a65b7ce12341891ae218a (patch)
treec453fee5f6c582f585757917e3562e6dbc5a6df3 /src/util.cpp
parent4b8a3ab877ceef0751839deafa401b01c492f7b1 (diff)
downloadbitcoin-337459b96b4fb270db0a65b7ce12341891ae218a.tar.xz
SetupEnvironment() - clean commit
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com> Rebased-From: 5248ff4
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index a919b4b854..521d54191f 100644
--- a/src/util.cpp
+++ b/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
+}