aboutsummaryrefslogtreecommitdiffstats
path: root/testing/namecoin/30-set-default-env.patch
blob: 5ff0162dc947e3635805afc6e8ef33c1036bcb44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -98,6 +98,16 @@
 #ifndef GUI
 int main(int argc, char* argv[])
 {
+    #ifndef WIN32
+    try
+    {
+        boost::filesystem::path::codecvt(); // Raises runtime error if current locale is invalid
+    } catch(std::runtime_error &e)
+    {
+        setenv("LC_ALL", "C", 1); // Force C locale
+    }
+    #endif
+
     bool fRet = false;
     fRet = AppInit(argc, argv);
 
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -122,6 +122,16 @@
 #ifndef BITCOIN_QT_TEST
 int main(int argc, char *argv[])
 {
+    #ifndef WIN32
+    try
+    {
+        boost::filesystem::path::codecvt(); // Raises runtime error if current locale is invalid
+    } catch(std::runtime_error &e)
+    {
+        setenv("LC_ALL", "C", 1); // Force C locale
+    }
+    #endif
+
     // Command-line options take precedence:
     ParseParameters(argc, argv);