FIX: fix plate name encoding issue

Change-Id: Ia89b2c5bbb4519ed938ae23ff124719cfe6203de
Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
Stone Li authored and Lane.Wei committed 2023-07-07 17:29:08 +08:00
1 parent 869a3046aa
commit 14cb2449c6
11 files changed
+45 -55

No files matched your search

+1 -14
View File
@@ -3318,19 +3318,6 @@ void SelectMachineDialog::set_flow_calibration_state(bool state)
}
}
std::string SelectMachineDialog::filter_characters(const std::string& str, const std::string& filterChars)
{
std::string filteredStr = str;
auto removeFunc = [&filterChars](char ch) {
return filterChars.find(ch) != std::string::npos;
};
filteredStr.erase(std::remove_if(filteredStr.begin(), filteredStr.end(), removeFunc), filteredStr.end());
return filteredStr;
}
void SelectMachineDialog::set_default()
{
if (m_print_type == PrintFromType::FROM_NORMAL) {
@@ -3365,7 +3352,7 @@ void SelectMachineDialog::set_default()
m_current_project_name = wxString::FromUTF8(filename_path.filename().string());
//unsupported character filter
m_current_project_name = filter_characters(m_current_project_name.ToStdString(), "<>[]:/\\|?*\"");
m_current_project_name = from_u8(filter_characters(m_current_project_name.ToUTF8().data(), "<>[]:/\\|?*\""));
m_rename_text->SetLabelText(m_current_project_name);
m_rename_normal_panel->Layout();