JT Noble SMS documentation home

Encoding and long messages

GSM 7-bit, UCS2, long messages with UDH and how segments are counted.

Two encodings

Encodingdata_codingUse forCharacters per SMS
GSM 7-bit0English and most Latin letters160
UCS28Any other script, emoji, some accented letters70

One character outside the GSM 7-bit set makes the whole message UCS2. Typing curly quotes or an emoji by mistake can double the cost.

These GSM characters count as two: ^ { } [ ] ~ \ | € and the form feed.

Long messages

A message longer than one SMS is split into segments. Each segment carries a small header (UDH) so the phone can join them back. The header takes some space, so each segment holds less:

EncodingOne segmentEach segment of a long message
GSM 7-bit160 characters153 characters
UCS270 characters67 characters

Examples:

MessageSegments
160 GSM characters1
161 GSM characters2 (153 + 8)
306 GSM characters2
307 GSM characters3
70 UCS2 characters1
71 UCS2 characters2 (67 + 4)

How to send a long message over SMPP

Split the message yourself and send one submit_sm per part, with UDH or SAR. Split into parts of 153 (GSM) or 67 (UCS2) characters. The phone joins them back.

Option 1, UDH (recommended):

  1. Start each part with a 6-byte UDH: 05 00 03 RR TT NN, where RR is a reference number shared by all parts, TT the total parts and NN this part's number, starting at 1.
  2. Set esm_class = 0x40 on every part.
  3. Send each part as its own submit_sm.

Option 2, SAR: leave the UDH out and put these TLVs on every part:

TLVTagValue
sar_msg_ref_num0x020CA reference number shared by all parts.
sar_total_segments0x020EThe total parts.
sar_segment_seqnum0x020FThis part's number, starting at 1.

message_payload

Not for long messages

The message_payload TLV works only for text that fits one SMS: up to 160 bytes, or 140 for UCS2 or binary. It is then moved to short_message for you. Anything longer is refused with 0x00000001 ESME_RINVMSGLEN and is not charged. JT Noble SMS does not split it for you.

What you pay

You pay one credit per segment. A 3-segment message costs 3 credits. On the HTTP API, the price is per segment too.

On this page