From 447dd1568138e1d950798d07c17afcc125e080d1 Mon Sep 17 00:00:00 2001 From: David Kocik Date: Mon, 19 Aug 2024 13:50:59 +0200 Subject: [PATCH] Fix of incorrect usage of wxString in fopen in AppUpdater and Downloader. --- src/slic3r/GUI/DownloaderFileGet.cpp | 4 ++-- src/slic3r/Utils/AppUpdater.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/DownloaderFileGet.cpp b/src/slic3r/GUI/DownloaderFileGet.cpp index 7a7c7044c2..cbb0ae4663 100644 --- a/src/slic3r/GUI/DownloaderFileGet.cpp +++ b/src/slic3r/GUI/DownloaderFileGet.cpp @@ -187,9 +187,9 @@ void FileGet::priv::get_perform() FILE* file; // open file for writting if (m_written == 0) - file = fopen(temp_path_wstring.c_str(), "wb"); + file = fopen(into_u8(temp_path_wstring).c_str(), "wb"); else - file = fopen(temp_path_wstring.c_str(), "ab"); + file = fopen(into_u8(temp_path_wstring).c_str(), "ab"); //assert(file != NULL); if (file == NULL) { diff --git a/src/slic3r/Utils/AppUpdater.cpp b/src/slic3r/Utils/AppUpdater.cpp index d3016eace7..9c12eafd16 100644 --- a/src/slic3r/Utils/AppUpdater.cpp +++ b/src/slic3r/Utils/AppUpdater.cpp @@ -222,7 +222,7 @@ boost::filesystem::path AppUpdater::priv::download_file(const DownloadAppData& d tmp_path += format(".%1%%2%", std::to_string(GUI::GLCanvas3D::timestamp_now()), ".download"); FILE* file; wxString temp_path_wstring(tmp_path.wstring()); - file = fopen(temp_path_wstring.c_str(), "wb"); + file = fopen(GUI::into_u8(temp_path_wstring).c_str(), "wb"); assert(file != NULL); if (file == NULL) { std::string line1 = GUI::format(_u8L("Download from %1% couldn't start:"), data.url);