Skip to content

Commit 53e4951

Browse files
committed
Switch to ANSI Windows API in fsbridge::fopen() function
1 parent dbe770d commit 53e4951

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/util/fs.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <sys/utsname.h>
1313
#include <unistd.h>
1414
#else
15-
#include <codecvt>
1615
#include <limits>
1716
#include <windows.h>
1817
#endif
@@ -28,8 +27,7 @@ FILE *fopen(const fs::path& p, const char *mode)
2827
#ifndef WIN32
2928
return ::fopen(p.c_str(), mode);
3029
#else
31-
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>,wchar_t> utf8_cvt;
32-
return ::_wfopen(p.wstring().c_str(), utf8_cvt.from_bytes(mode).c_str());
30+
return ::fopen(p.utf8string().c_str(), mode);
3331
#endif
3432
}
3533

0 commit comments

Comments
 (0)