linux not use gbk.

This commit is contained in:
amass 2024-12-16 16:59:23 +08:00
parent 8f72fbded7
commit 7c2a29740b

View File

@ -453,7 +453,11 @@ void DeviceConnection::requestOta(const QString &firmware, const QString &file)
Task task;
task.command = "a22devicefirmware_setdata";
task.task = [this, file, firmware]() {
#ifdef Q_OS_LINUX
std::ifstream ifs(file.toStdString(), std::ifstream::binary);
#else
std::ifstream ifs(Amass::StringUtility::UTF8ToGBK(file.toStdString()), std::ifstream::binary);
#endif
m_uploadBuffer = std::vector<uint8_t>((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
m_sendedSize = 0;