From 1a0911388d39a6e281495367c3144fbb5834b68c Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 20 Oct 2023 14:44:14 +0200 Subject: [PATCH] Fixed several encoding issues --- src/slic3r/GUI/Field.cpp | 4 ++-- src/slic3r/GUI/MainFrame.cpp | 6 +++--- src/slic3r/GUI/OptionsGroup.cpp | 4 ++-- src/slic3r/GUI/Plater.cpp | 6 +++--- src/slic3r/GUI/Tab.cpp | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index fd222d2f8a..20096f9426 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -1283,8 +1283,8 @@ void Choice::set_values(const std::vector& values) auto value = ww->GetValue(); ww->Clear(); ww->Append(""); - for (const auto &el : values) - ww->Append(wxString(el)); + for (const std::string& el : values) + ww->Append(from_u8(el)); ww->SetValue(value); m_disable_change_event = false; diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 74f28933ec..b1d33abb6b 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1929,12 +1929,12 @@ void MainFrame::load_config_file() const auto* post_process = config.opt("post_process"); if (post_process != nullptr && !post_process->values.empty()) { const wxString msg = _L("The selected config file contains a post-processing script.\nPlease review the script carefully before exporting G-code."); - wxString text; - for (const auto& s : post_process->values) { + std::string text; + for (const std::string& s : post_process->values) { text += s; } - InfoDialog msg_dlg(nullptr, msg, text, true, wxOK | wxICON_WARNING); + InfoDialog msg_dlg(nullptr, msg, from_u8(text), true, wxOK | wxICON_WARNING); msg_dlg.set_caption(wxString(SLIC3R_APP_NAME " - ") + _L("Attention!")); msg_dlg.ShowModal(); } diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index bf6c8571a3..be5755974a 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -943,8 +943,8 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config else if (opt->gui_flags == "serialized") { std::vector values = config.option(opt_key)->values; if (!values.empty() && !values[0].empty()) - for (auto el : values) - text_value += el + ";"; + for (const std::string& el : values) + text_value += from_u8(el) + ";"; ret = text_value; } else diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 67f5c1fe75..38f84004e2 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2619,11 +2619,11 @@ std::vector Plater::priv::load_files(const std::vector& input_ // TRN The placeholder is either "3MF" or "AMF" wxString msg = GUI::format_wxstr(_L("The selected %1% file contains a post-processing script.\n" "Please review the script carefully before exporting G-code."), type_3mf ? "3MF" : "AMF" ); - wxString text; - for (const auto& s : post_process->values) + std::string text; + for (const std::string& s : post_process->values) text += s; - InfoDialog msg_dlg(nullptr, msg, text, true, wxOK | wxICON_WARNING); + InfoDialog msg_dlg(nullptr, msg, from_u8(text), true, wxOK | wxICON_WARNING); msg_dlg.set_caption(wxString(SLIC3R_APP_NAME " - ") + _L("Attention!")); msg_dlg.ShowModal(); } diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 9f6409e25d..1c94c608d1 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1372,10 +1372,10 @@ void Tab::update_preset_description_line() if (!default_filament_profiles.empty()) { description_line += "\n\n\t" + _(L("default filament profile")) + ": \n\t\t"; - for (auto& profile : default_filament_profiles) { + for (const std::string& profile : default_filament_profiles) { if (&profile != &*default_filament_profiles.begin()) description_line += ", "; - description_line += profile; + description_line += from_u8(profile); } } break;