From 0882a398a0737568b49d1bcae6d4d24c4c39492d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 25 Nov 2013 14:07:06 +0000 Subject: [PATCH] Add voodoo to set locale for boost::filesystem. --- src/lib/util.cc | 7 +++++++ 1 file changed, 7 insertions(+) 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 (); -- 2.30.2