Skip to content

tom_modem: add Turkish character support for SMS - #257

Closed
ozgunokan wants to merge 1 commit into
FUjr:mainfrom
ozgunokan:sms-tr-charset-support
Closed

tom_modem: add Turkish character support for SMS#257
ozgunokan wants to merge 1 commit into
FUjr:mainfrom
ozgunokan:sms-tr-charset-support

Conversation

@ozgunokan

Copy link
Copy Markdown

Adds Turkish character (İ, ı, ğ, ü, ş, ö, ç etc.) encoding/decoding
support for SMS send/receive in tom_modem, covering PDU parsing
(extlib/pdu.c) and the SMS operations/utility layer.

Tested on IPQ807x (Arcadyan AW1000, Quectel RG500Q-EA).

@ozgunokan

Copy link
Copy Markdown
Author

Closing this — the same change has been merged into the qmodem-edma
branch/PR (#[PR numarasını buraya yazın]) along with an unrelated
kernel 6.18 compatibility fix, to keep things together. Sorry for
the duplicate.

@ozgunokan ozgunokan closed this Aug 29, 2026
@ozgunokan
ozgunokan deleted the sms-tr-charset-support branch August 29, 2026 11:08
@FUjr

FUjr commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Thank you for the Turkish SMS contribution. I reviewed this change together with PR #256. Closing this duplicate was the right call; the remaining implementation concern is that Turkish national locking/single-shift mappings must be selected through the PDU's UDH language information rather than applied globally. That correction will avoid changing the decoding of non-Turkish GSM 7-bit messages. Thanks again for the contribution and the hardware testing.

FUjr pushed a commit to ozgunokan/QModem-NSS that referenced this pull request Sep 8, 2026
Addresses review feedback on FUjr#257/FUjr#256: the Turkish national language
extension mappings were previously written directly into the shared
gsm7bits_extend_to_latin1 table, so every GSM 7-bit message decoded
through it regardless of language -- reserved extension codes used by
other languages/future 3GPP additions could have been misdecoded as
Turkish characters.

This moves the Turkish mappings into a separate turkish_extend_to_latin1
table and adds udh_has_turkish_shift(), which walks the PDU's User Data
Header IEs and only selects that table when a National Language Locking
Shift (IEI 0x24) or Single Shift (IEI 0x25) IE explicitly selects Turkish
(language id 0x01, per 3GPP TS 23.038 table 6.2.1.2.5). Every other
message continues to decode through the original, unmodified table.

Also adds a bounds check in sms_send() (operations.c): profile->sms_pdu
was hex-encoded into a fixed 512-byte pdu_hex buffer with no upper
bound on the source PDU length, which could overflow the stack buffer
for a long/malformed PDU. This rejects PDUs longer than 255 chars
(the max that fits pdu_hex[512] as hex + terminator) up front.

Tested on Arcadyan AW1000 (Quectel RG500Q-EA), IPQ807x: Turkish SMS
with the language shift IE set decode correctly; a batch of non-Turkish
GSM 7-bit messages (EN/DE test SMS) decode unchanged before and after
this patch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants