From: Carl Hetherington Date: Mon, 25 Nov 2013 14:07:06 +0000 (+0000) Subject: Add voodoo to set locale for boost::filesystem. X-Git-Tag: v2.0.48~1108^2~15^2~18 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=0882a398a0737568b49d1bcae6d4d24c4c39492d Add voodoo to set locale for boost::filesystem. --- diff --git a/src/lib/util.cc b/src/lib/util.cc index 4a9998141..d99c3801f 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -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 ();