Use the set locale for boost::lexical_cast to fix #824.
authorCarl Hetherington <cth@carlh.net>
Sun, 13 Mar 2016 01:03:26 +0000 (01:03 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 13 Mar 2016 01:03:26 +0000 (01:03 +0000)
ChangeLog
src/lib/util.cc

index b33b4ae0738e2b03d7fae2bbda51ead75c3b8ee1..0aa5b155adb6c2757b14a30c14214e3d22a6264e 100644 (file)
--- 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.
index 81963e0aa5bdac0cb4f3ca31f9392d4845cd76cb..f434f358e38982c1ee7f6c3afe9b830d070c81a3 100644 (file)
@@ -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());