Licensed carrier in Costa Rica · Resolution RCS-251-2019
SMS and messaging

Encoding, segments and delivery receipts: the mechanics behind every SMS

Why a Spanish accent can double your SMS cost, how segmentation works, and how to read delivery receipts correctly in production.

Most teams treat an SMS as a string they hand to an API. In practice, every message goes through character encoding, segmentation and a delivery-reporting loop, and each step has consequences for cost, deliverability and the experience on the recipient’s handset. This article covers those mechanics so you can design messaging that behaves predictably.

Character encoding: GSM-7 versus UCS-2

An SMS payload is limited to 140 bytes. How many characters fit depends on the encoding. With GSM-7, the default alphabet, each character uses 7 bits, so a single message holds 160 characters. If any character in the message falls outside that alphabet, the entire message switches to UCS-2, which uses 16 bits per character and caps a single message at 70 characters.

This matters for Spanish. The GSM-7 basic set includes ñ, é, ü, ¿ and ¡, but it does not include á, í, ó or ú. A single “código” or “información” in your template is enough to move the whole message to UCS-2. Other common triggers are curly quotes pasted from word processors, long dashes and emojis.

There is also an extension table in GSM-7. Characters such as €, [, ], {, }, ~, ^, \ and | are valid but consume two septets each, so they quietly reduce the available length.

Segmentation and concatenation

When text exceeds one message, it is split into segments and reassembled on the handset using a User Data Header. That header takes space from each segment, so the limits drop: 153 characters per segment in GSM-7 and 67 in UCS-2.

Segments are typically billed individually. A 161-character GSM-7 message is two segments; the same text with one accented vowel becomes three UCS-2 segments. For high-volume notifications, a template review is one of the simplest cost controls available. Practical rules:

  • Decide deliberately whether templates need full accents, and test the exact rendered string, including variables.
  • Normalize input: replace curly quotes and long dashes before submission.
  • Count length after variable substitution, not on the template itself.
  • Keep critical content, such as a code or amount, in the first segment.

Delivery receipts: what they actually tell you

Over SMPP, you send messages with submit_sm and receive delivery receipts (DLRs) through deliver_sm. A receipt carries the message ID and a final state. The common ones are DELIVRD, UNDELIV, EXPIRED, REJECTD, DELETED and UNKNOWN, with ACCEPTD and ENROUTE as intermediate states on some routes.

A few points are frequently misread. The response to submit_sm means the platform accepted the message, not that it reached a phone. EXPIRED usually means the handset was unreachable for the whole validity period, so a shorter validity is appropriate for time-sensitive content such as verification codes. And for concatenated messages, receipts may arrive per segment, so your system should map them back to the logical message.

Designing for reliability

Store message IDs and correlate every receipt. Alert on shifts in the ratio of delivered to undelivered by destination network, not just on API errors. Set validity periods per use case. Retry with care: resending on a missing receipt can produce duplicates if the original was simply delayed. Finally, keep a bind open with proper enquire_link keepalives rather than reconnecting per message, which adds latency and load.

Where Ring fits

Ring is a SUTEL-licensed carrier (resolution RCS-251-2019) operating a 100% IP network under AS274239, with POPs in San José and Virginia and direct interconnection with the SNT. smpp.cr gives developers SMPP and API access to SMS with delivery receipts, so the mechanics described here are visible and measurable in your own systems. Our team provides 24/7 support for integration questions, from data_coding settings to receipt handling.

← Back to the blog

Want to build on a better network?

Talk to a sales engineer and start today.

Talk to sales