Add voodoo to set locale for boost::filesystem.
authorCarl Hetherington <cth@carlh.net>
Mon, 25 Nov 2013 14:07:06 +0000 (14:07 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 25 Nov 2013 14:07:06 +0000 (14:07 +0000)
src/lib/util.cc

index 4a9998141d5ddf2d44f7c8b100683beee850a5d5..d99c3801f665b8a77215adb8f3804753c04acf4b 100644 (file)
@@ -277,6 +277,13 @@ dcpomatic_setup ()
        backtrace_file /= g_get_user_config_dir ();
        backtrace_file /= "backtrace.txt";
        SetUnhandledExceptionFilter(exception_handler);
+
+       /* Dark voodoo which, I think, gets boost::filesystem::path to
+          correctly convert UTF-8 strings to paths, and also paths
+          back to UTF-8 strings (on path::string()).
+       */
+       std::locale::global (boost::locale::generator().generate (""));
+       boost::filesystem::path::imbue (std::locale ());
 #endif 
        
        avfilter_register_all ();