Fit every concatenated segment in an SMS, and close the encoding helpers' throw (#96)

* Regression tests for the concatenated segment budget and the encoding-name door

* Budget unpacked segments at 134 octets, and export isEncodingName

* Name the length a Latin-1 message starts costing more segments at

* Fold the totality clause into hard rule 1, and log the unrepresentable-alphabet finding

* Make the maxSegments regression discriminate, and drop the narrating comments

* State the per-alphabet capacities accurately, and log the invalid-date path
This commit is contained in:
2026-09-09 17:21:51 +02:00
committed by GitHub
parent ff6ba9f825
commit 7d6039796d
7 changed files with 131 additions and 30 deletions
+5 -2
View File
@@ -132,8 +132,11 @@ It travels in `data_coding` beside the alphabet, so a flash UCS2 message stays U
8-bit data or UCS2, and 8-bit data is not text a handset will display — so the send is refused
before anything goes out.
Messages too long for one SMS are split automatically and sent as a concatenated message. You get
one id per segment:
Messages too long for one SMS are split automatically and sent as a concatenated message. One SMS
holds 160 characters as `ASCII`, 140 as `LATIN1` or 70 as `UCS2`, and the concatenation header a
longer message needs takes room off each segment: 153, 134 and 67. GSM's extension characters
(`{}[]\~^|€` and form feed) count as two, as does a character outside the basic multilingual plane
in `UCS2`. You get one id per segment:
```javascript
const { err, pduObjs, smsIds, unanswered } = await session.sendSms({ from, message, to });