diff --git a/src/slic3r/GUI/EditGCodeDialog.cpp b/src/slic3r/GUI/EditGCodeDialog.cpp index 0afbb18a1e..3dff82d610 100644 --- a/src/slic3r/GUI/EditGCodeDialog.cpp +++ b/src/slic3r/GUI/EditGCodeDialog.cpp @@ -75,11 +75,12 @@ EditGCodeDialog::EditGCodeDialog(wxWindow* parent, const std::string& key, const m_add_btn = new ScalableButton(this, wxID_ANY, "add_copies"); m_add_btn->SetToolTip(_L("Add selected placeholder to G-code")); - m_gcode_editor = new wxTextCtrl(this, wxID_ANY, value, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE -#ifdef _WIN32 - | wxBORDER_SIMPLE -#endif + m_gcode_editor = new wxTextCtrl(this, wxID_ANY, wxString::FromUTF8(value), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE + #ifdef _WIN32 + | wxBORDER_SIMPLE + #endif ); + m_gcode_editor->SetFont(wxGetApp().code_font()); m_gcode_editor->SetInsertionPointEnd(); wxGetApp().UpdateDarkUI(m_gcode_editor); @@ -131,7 +132,8 @@ EditGCodeDialog::~EditGCodeDialog() std::string EditGCodeDialog::get_edited_gcode() const { - return into_u8(m_gcode_editor->GetValue()); + wxString text = m_gcode_editor->GetValue(); + return std::string(text.ToUTF8()); } void EditGCodeDialog::on_search_update()