From 161aa667c9707abf598e01545d76d8aa53c03bf4 Mon Sep 17 00:00:00 2001 From: MengMengCode <227010654+MengMengCode@users.noreply.github.com> Date: Wed, 19 Aug 2026 21:41:31 +0800 Subject: [PATCH] FIX #59 --- internal/device/sms_pdu.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/device/sms_pdu.go b/internal/device/sms_pdu.go index d627b12..4db3fc1 100644 --- a/internal/device/sms_pdu.go +++ b/internal/device/sms_pdu.go @@ -548,6 +548,14 @@ func decodeGSM7(septets []byte) (string, error) { return result.String(), nil } +// DecodeGSM7Septets decodes a GSM 7-bit default-alphabet string whose septets +// are stored one code per byte (the form USSI bodies use when DCS=0x0F). It +// returns the decoded text and ok=false if a code is out of range. +func DecodeGSM7Septets(data string) (string, bool) { + decoded, err := decodeGSM7([]byte(data)) + return decoded, err == nil +} + type pduCursor struct { data []byte index int