diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-08-10 22:13:22 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-08-10 22:44:31 +0100 |
| commit | ab778ced048cad27b7c10808acfa93861ea91fce (patch) | |
| tree | 37e04b2b36ff78e3c901c5f650f50210ea018c8a /src/lib | |
| parent | c14ea4bf3907eb2a4f643a445cc4b232a6d425ce (diff) | |
Set up for the correct handling of UTF-8 with Windows
paths before trying to access the config file. Fixes #654.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/util.cc | 24 | ||||
| -rw-r--r-- | src/lib/util.h | 1 |
2 files changed, 16 insertions, 9 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc index ede1d4e9b..56f1b5286 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -280,18 +280,10 @@ terminate () abort(); } -/** Call the required functions to set up DCP-o-matic's static arrays, etc. - * Must be called from the UI thread, if there is one. - */ void -dcpomatic_setup () +dcpomatic_setup_path_encoding () { #ifdef DCPOMATIC_WINDOWS - boost::filesystem::path p = g_get_user_config_dir (); - p /= "backtrace.txt"; - set_backtrace_file (p); - 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()). @@ -307,6 +299,20 @@ dcpomatic_setup () std::locale::global (boost::locale::generator().generate ("")); boost::filesystem::path::imbue (std::locale ()); #endif +} + +/** Call the required functions to set up DCP-o-matic's static arrays, etc. + * Must be called from the UI thread, if there is one. + */ +void +dcpomatic_setup () +{ +#ifdef DCPOMATIC_WINDOWS + boost::filesystem::path p = g_get_user_config_dir (); + p /= "backtrace.txt"; + set_backtrace_file (p); + SetUnhandledExceptionFilter(exception_handler); +#endif avfilter_register_all (); diff --git a/src/lib/util.h b/src/lib/util.h index be21fc89a..95d272979 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -65,6 +65,7 @@ extern std::string seconds_to_hms (int); extern std::string seconds_to_approximate_hms (int); extern double seconds (struct timeval); extern void dcpomatic_setup (); +extern void dcpomatic_setup_path_encoding (); extern void dcpomatic_setup_gettext_i18n (std::string); extern std::string md5_digest_head_tail (std::vector<boost::filesystem::path>, boost::uintmax_t size); extern void ensure_ui_thread (); |
