From 2ea7e3b344940017c2537f992305cf656f730713 Mon Sep 17 00:00:00 2001 From: mntone Date: Sun, 21 May 2017 10:44:54 +0900 Subject: [PATCH] UI: Fix creation of crash log with non-english paths --- UI/obs-app.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index c08888f32..72439fbe2 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -1414,8 +1414,16 @@ static void main_crash_handler(const char *format, va_list args, void *param) BPtr path(GetConfigPathPtr(name.c_str())); fstream file; - file.open(path, ios_base::in | ios_base::out | ios_base::trunc | + +#ifdef _WIN32 + BPtr wpath; + os_utf8_to_wcs_ptr(path, 0, &wpath); + file.open(wpath, ios_base::in | ios_base::out | ios_base::trunc | ios_base::binary); +#else + file.open(path, ios_base::in | ios_base::out | ios_base::trunc | + ios_base::binary); +#endif file << text; file.close();