diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-10-06 23:54:32 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-10-13 18:51:11 +0200 |
| commit | a6f1c4deaf0ddbf0197b286d0d5f1a107a487deb (patch) | |
| tree | b09eeb068a88f1c1ccf0c83c60bca10098250a7b | |
| parent | 88d217034d58a02514eedbccd88dbfa2f80a9cc2 (diff) | |
Hack to allow us to make a valid boost::filesystem::path from a
UTF8 constant on Windows. This might actually be a way to get around
the fopen_boost hacks.
| -rw-r--r-- | test/file_naming_test.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/file_naming_test.cc b/test/file_naming_test.cc index 160fc0813..d0db2f30a 100644 --- a/test/file_naming_test.cc +++ b/test/file_naming_test.cc @@ -29,6 +29,9 @@ #include "lib/ffmpeg_content.h" #include "lib/dcp_content_type.h" #include "lib/video_content.h" +#ifdef DCPOMATIC_WINDOWS +#include <boost/locale.hpp> +#endif #include <boost/test/unit_test.hpp> #include <boost/regex.hpp> @@ -111,6 +114,13 @@ BOOST_AUTO_TEST_CASE (file_naming_test2) shared_ptr<Film> film = new_test_film ("file_naming_test2"); film->set_name ("file_naming_test2"); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR")); + +#ifdef DCPOMATIC_WINDOWS + /* This is necessary so that the UTF8 string constant below gets converted properly */ + std::locale::global(boost::locale::generator().generate("")); + boost::filesystem::path::imbue(std::locale()); +#endif + shared_ptr<FFmpegContent> r (new FFmpegContent("test/data/flät_red.png")); film->examine_and_add_content (r); shared_ptr<FFmpegContent> g (new FFmpegContent("test/data/flat_green.png")); |
