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 0d837e2587
commit bc34f9e223
1 changed files with 4 additions and 2 deletions

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();
}