From bbd0a37bd282c8cb79d20522db446e4989f83661 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 28 Nov 2016 20:30:36 +0100 Subject: [PATCH] ImFileOpen: MinGW uses _wfopen() codepath to support UTF-8 filenames (#917) --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 23ed4ca4..81055351 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1295,7 +1295,7 @@ void ImGui::ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& FILE* ImFileOpen(const char* filename, const char* mode) { -#ifdef _MSC_VER +#if defined(_WIN32) && !defined(__CYGWIN__) // We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames. Converting both strings from UTF-8 to wchar format (using a single allocation, because we can) const int filename_wsize = ImTextCountCharsFromUtf8(filename, NULL) + 1; const int mode_wsize = ImTextCountCharsFromUtf8(mode, NULL) + 1;