From 7c2a29740bfa58d97c6d866cd6aea15187d2d68f Mon Sep 17 00:00:00 2001 From: amass <168062547@qq.com> Date: Mon, 16 Dec 2024 16:59:23 +0800 Subject: [PATCH] linux not use gbk. --- DeviceConnection.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DeviceConnection.cpp b/DeviceConnection.cpp index 182fe46..ff0b450 100644 --- a/DeviceConnection.cpp +++ b/DeviceConnection.cpp @@ -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((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); m_sendedSize = 0;