summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-03-13 01:03:26 +0000
committerCarl Hetherington <cth@carlh.net>2016-03-13 01:03:26 +0000
commitea35bff04d7a96f44ea595951bb0c0dd54c8ee52 (patch)
tree13ff962a9d29743b3bb697d59f6e856310415825
parent6bdf43931787f1f0b9f7dad2d5636ac78d29cdf2 (diff)
Use the set locale for boost::lexical_cast to fix #824.
-rw-r--r--ChangeLog5
-rw-r--r--src/lib/util.cc5
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b33b4ae07..0aa5b155a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-13 Carl Hetherington <cth@carlh.net>
+
+ * Fix crash when using non-English decimal separators
+ in the audio gain calculator dialogue (#824).
+
2016-03-12 Carl Hetherington <cth@carlh.net>
* Add 2.35:1 ratio.
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 81963e0aa..f434f358e 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -389,6 +389,11 @@ dcpomatic_setup_gettext_i18n (string lang)
setlocale (LC_ALL, "");
textdomain ("libdcpomatic2");
+ /* This sets up the locale to be used by lexical_cast (and probably other stuff);
+ used by e.g. the audio gain calculator dialogue where we lexical_cast floating
+ point values.
+ */
+ std::locale::global (std::locale (""));
#if defined(DCPOMATIC_WINDOWS) || defined(DCPOMATIC_OSX)
bindtextdomain ("libdcpomatic2", mo_path().string().c_str());