From d1bfdbaa63d5f764bd388da9958550cb1604ad26 Mon Sep 17 00:00:00 2001 From: srcejon Date: Wed, 20 Mar 2024 12:14:42 +0000 Subject: [PATCH] PacketMod: Fix UTF-8 encoding. --- plugins/channeltx/modpacket/packetmodsource.cpp | 5 +++-- plugins/channeltx/modpacket/readme.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/channeltx/modpacket/packetmodsource.cpp b/plugins/channeltx/modpacket/packetmodsource.cpp index 63ae3b7fe..834b4d2b8 100644 --- a/plugins/channeltx/modpacket/packetmodsource.cpp +++ b/plugins/channeltx/modpacket/packetmodsource.cpp @@ -592,8 +592,9 @@ void PacketModSource::addTXPacket(QString callsign, QString to, QString via, QSt // PID *p++ = m_settings.m_ax25PID; // Data - len = data.length(); - memcpy(p, data.toUtf8(), len); + QByteArray dataBytes = data.toUtf8(); + len = dataBytes.length(); + memcpy(p, dataBytes, len); p += len; // CRC (do not include flags) crc.calculate(crc_start, p-crc_start); diff --git a/plugins/channeltx/modpacket/readme.md b/plugins/channeltx/modpacket/readme.md index c38e07f56..21af80f69 100644 --- a/plugins/channeltx/modpacket/readme.md +++ b/plugins/channeltx/modpacket/readme.md @@ -74,7 +74,7 @@ Enter the routing for the packet. To have the packet repeated by digipeaters, us

16: Data

-The packet of data to send. To send an APRS status message, use the format >Status. The APRS specification can be found at: http://www.aprs.org/doc/APRS101.PDF. APRS messages can be tracked on https://aprs.fi +The packet of data to send. This is encoded using UTF-8. To send an APRS status message, use the format >Status. The APRS specification can be found at: http://www.aprs.org/doc/APRS101.PDF. APRS messages can be tracked on https://aprs.fi

17: TX