FIX:fixed sending print failure due to long plate name

Change-Id: I89f32f7d7f214d55051e736f834e0e49d7c808ab
This commit is contained in:
tao wang 2023-08-04 17:25:57 +08:00 committed by lane.wei
parent 0aa638c729
commit f00dc9c675

View file

@ -70,9 +70,11 @@ std::string PrintJob::truncate_string(const std::string& str, size_t maxLength)
return str;
}
std::string truncatedStr = str.substr(0, maxLength - 3);
wxString local_str = wxString::FromUTF8(str);
wxString truncatedStr = local_str.Mid(0, maxLength - 3);
truncatedStr.append("...");
return truncatedStr;
return truncatedStr.utf8_string();
}