diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-11-25 00:28:26 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-11-25 00:28:26 +0000 |
| commit | a9dd3d27bc52f853309885b1be02d6efd2d2af48 (patch) | |
| tree | 34ca2469fff6d71a85edef547d793d58fe7a0df7 /src/lib/cross.cc | |
| parent | ad0ddd25c94730bed174756a21c83a348c45687e (diff) | |
Add fopen_boost; remove a couple of defunct usings.
Diffstat (limited to 'src/lib/cross.cc')
| -rw-r--r-- | src/lib/cross.cc | 16 |
1 files changed, 16 insertions, 0 deletions
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 +} |
