SMS YANU 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

Option 1, UDH (recommended):

  1. Split the text into parts of 153 (GSM) or 67 (UCS2) characters.
  2. 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.
  3. Set esm_class = 0x40 on every part.
  4. Send each part as its own submit_sm.

Option 2, message_payload: put the full text in the message_payload TLV and leave short_message empty. We 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.

To be confirmed

Use UDH where you can. Support for the message_payload TLV, and the most segments allowed in one message, have not yet been checked on the live SMS YANU server.

On this page