summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc1
-rw-r--r--src/lib/cross.cc16
-rw-r--r--src/lib/cross.h1
3 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 4b6455f51..2420ab1b5 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -41,7 +41,6 @@
using std::vector;
using std::ifstream;
using std::string;
-using std::ofstream;
using std::list;
using std::max;
using std::exception;
diff --git a/src/lib/cross.cc b/src/lib/cross.cc
index 41051ee2e..9aa8454c9 100644
--- a/src/lib/cross.cc
+++ b/src/lib/cross.cc
@@ -269,3 +269,19 @@ openssl_path ()
#endif
}
+
+/* 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 *
+fopen_boost (boost::filesystem::path p, string t)
+{
+#ifdef DCPOMATIC_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
+}
diff --git a/src/lib/cross.h b/src/lib/cross.h
index 1fe34edbe..931e7d890 100644
--- a/src/lib/cross.h
+++ b/src/lib/cross.h
@@ -33,3 +33,4 @@ extern boost::filesystem::path openssl_path ();
#ifdef DCPOMATIC_OSX
extern boost::filesystem::path app_contents ();
#endif
+extern FILE * fopen_boost (boost::filesystem::path, std::string);