aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-11-21 10:13:10 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-11-21 10:13:10 +0000
commitf3724aef881ff2fdada98eddc792059e4e18c1c8 (patch)
tree492dc86b5344060870877c0a886f67d2c1eaa0b8 /src/common/util.h
parenti18n: allow language to be passed as a parameter (diff)
downloadmonero-f3724aef881ff2fdada98eddc792059e4e18c1c8.tar.xz
Fix startup crash when using a locale boost does not like
There are various locale related bugs in various versions of boost, where exceptions are thrown in boost::filesystem APIs when the current locale is not to boost's liking. It's not clear what "not to boost's liking" means in detail, though "en" and "en_US.UTF-8" are not to its liking. Fix it by running a test function that's known to throw in such a case, and resetting LANG and LC_ALL to C if an exception is thrown. In simplewallet, the locale is queried before that so the correct translations will still be used.
Diffstat (limited to '')
-rw-r--r--src/common/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h
index 883fe1e0f..236a0b6f0 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -88,6 +88,8 @@ namespace tools
*/
std::error_code replace_file(const std::string& replacement_name, const std::string& replaced_name);
+ bool sanitize_locale();
+
inline crypto::hash get_proof_of_trust_hash(const nodetool::proof_of_trust& pot)
{
std::string s;