tom_modem: add Turkish character support for SMS - #257
Closed
ozgunokan wants to merge 1 commit into
Closed
Conversation
Author
|
Closing this — the same change has been merged into the qmodem-edma |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).