diff options
Diffstat (limited to 'src/util.cc')
| -rw-r--r-- | src/util.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc index 59078511..8624ae51 100644 --- a/src/util.cc +++ b/src/util.cc @@ -343,3 +343,20 @@ libdcp::ptime_to_string (boost::posix_time::ptime t) struct tm t_tm = boost::posix_time::to_tm (t); return tm_to_string (&t_tm); } + + +/* Apparently there is no way to create an ofstream using a UTF-8 + filename under Windows. We are hence reduced to using fopen + with this wrapper. +*/ +FILE * +libdcp::fopen_boost (boost::filesystem::path p, string t) +{ +#ifdef LIBDCP_WINDOWS + wstring w (t.begin(), t.end()); + /* c_str() here should give a UTF-16 string */ + return _wfopen (p.c_str(), w.c_str ()); +#else + return fopen (p.c_str(), t.c_str ()); +#endif +} |
