Firmware Updater: Handle messages in non-UTF-8 encoding on Windows

This commit is contained in:
Vojtech Kral 2019-02-22 14:55:00 +01:00
parent 91ccdb0a4d
commit 4f63f65d3d

View file

@ -588,6 +588,13 @@ void FirmwareDialog::priv::perform_upload()
auto evt = new wxCommandEvent(EVT_AVRDUDE, q->GetId());
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->SetString(std::move(wxmsg));
wxQueueEvent(q, evt);