Firmware Updater: Handle messages in non-UTF-8 encoding on Windows
This commit is contained in:
parent
91ccdb0a4d
commit
4f63f65d3d
1 changed files with 7 additions and 0 deletions
|
@ -588,6 +588,13 @@ void FirmwareDialog::priv::perform_upload()
|
||||||
|
|
||||||
auto evt = new wxCommandEvent(EVT_AVRDUDE, q->GetId());
|
auto evt = new wxCommandEvent(EVT_AVRDUDE, q->GetId());
|
||||||
auto wxmsg = wxString::FromUTF8(msg);
|
auto wxmsg = wxString::FromUTF8(msg);
|
||||||
|
#ifdef WIN32
|
||||||
|
// The string might be in local encoding
|
||||||
|
if (wxmsg.IsEmpty() && *msg != '\0') {
|
||||||
|
wxmsg = wxString(msg);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
evt->SetExtraLong(AE_MESSAGE);
|
evt->SetExtraLong(AE_MESSAGE);
|
||||||
evt->SetString(std::move(wxmsg));
|
evt->SetString(std::move(wxmsg));
|
||||||
wxQueueEvent(q, evt);
|
wxQueueEvent(q, evt);
|
||||||
|
|
Loading…
Reference in a new issue