From d7205c94613ef54cc41a16759875c6e87eca1605 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Thu, 15 Jul 2021 08:33:45 +0200 Subject: [PATCH] Let's hope that the std::exception::what() returns either a 7-bit string or an UTF-8 string. Let's convert it to wxString before showing an error message box. boost::system shall return UTF-8 localized error messages as long as we set -DBOOST_SYSTEM_USE_UTF8 in the top most CMakeFiles.txt, which we do. --- src/slic3r/GUI/GUI_App.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 13246c543..2c4d07a66 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -608,7 +608,7 @@ static void generic_exception_handle() std::terminate(); throw; } catch (const std::exception& ex) { - wxLogError("Internal error: %s", ex.what()); + wxLogError("Internal error: %s", wxString::FromUTF8(ex.what())); BOOST_LOG_TRIVIAL(error) << boost::format("Uncaught exception: %1%") % ex.what(); throw; }