aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fs.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fs.cpp b/src/fs.cpp
index 2dbc13643b..a34a88216a 100644
--- a/src/fs.cpp
+++ b/src/fs.cpp
@@ -11,7 +11,12 @@ namespace fsbridge {
FILE *fopen(const fs::path& p, const char *mode)
{
+#ifndef WIN32
return ::fopen(p.string().c_str(), mode);
+#else
+ std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>,wchar_t> utf8_cvt;
+ return ::_wfopen(p.wstring().c_str(), utf8_cvt.from_bytes(mode).c_str());
+#endif
}
#ifndef WIN32