Skip to main content

Localize SMS Messages Without Doubling Segment Costs

2026-11-30

Localize SMS Messages Without Doubling Segment Costs

Your English appointment reminder is 109 characters and fits in one SMS. The French version is 136 characters, also under the 160-character SMS character limit, yet your provider bills three segments for it. Nothing is wrong with the French. One curly apostrophe changed the encoding of the whole message, and the limit dropped from 160 characters to 67 per segment.

This guide is for engineers and localization leads who send transactional, marketing, or verification texts in more than one language. It explains why translations change the encoding, how to budget each template per locale, what to do about letters your alphabet cannot avoid, and how to catch the problem in CI before it shows up on an invoice.

The short answer

  1. Treat the SMS character limit as two limits. A message that uses only the GSM 03.38 alphabet is sent as GSM-7, with 160 characters in one message or 153 per segment. One character outside that alphabet switches the whole message to UCS-2, with 70 characters or 67 per segment.
  2. Budget every translated template against the encoding it will use, and leave room for variables and links.
  3. Lint translations for typography that forces UCS-2, and normalize text to NFC before you count.
  4. Decide per market whether to accept UCS-2, use a national language shift table, or transliterate.
  5. Pass the user's chosen language to your verification provider instead of letting it guess.
  6. Check the encoding and segment count of every template and locale in CI, then confirm with the provider's own report.

Why translations change the encoding

Twilio's explanation of SMS length gives the numbers most teams half remember: 160 GSM-7 characters or 70 UCS-2 characters in a single message, and 153 or 67 per segment once a message is split, because each segment carries a header that lets the phone reassemble it. Twilio also gives the example that matters for translation: a 140-character message with a single non-GSM character is sent as two segments. AWS End User Messaging documents the same 153 and 67 character parts and bills each part as a message.

The GSM-7 alphabet is small. The Unicode mapping of GSM 03.38 lists 128 basic characters and 10 extension characters reached through an escape code. It includes English letters, digits, common punctuation, and a selection of Western European letters such as é, è, à, ü, ö, ñ, and ø. It does not include á, í, ó, ú, â, ê, ã, õ, ł, ś, ş, ğ, or ı. The standard itself, published here as the ARIB transposition of 3GPP TS 23.038, states that each extension character reduces the displayable count by one and that the UCS2 alternative holds up to 70 characters.

We checked the letters of common languages against that table. German, Italian, Swedish, Danish, and Finnish letters fit. French loses â, ê, î, ô, û, ë, ï, ÿ, and œ. Spanish loses á, í, ó, and ú. Portuguese, Polish, Turkish, Romanian, Czech, Hungarian, Estonian, and Vietnamese each have common letters outside GSM-7, and Greek, Cyrillic, Arabic, Hebrew, Hindi, Chinese, and Japanese text is UCS-2 from the first character. Twilio Verify's language list warns that its own Portuguese, Brazilian Portuguese, Czech, and Greek templates may be split into multiple segments.

A Stack Overflow question on reliable SMS encoding in PHP has more than 23,000 views and is about exactly this trade-off between 160 GSM characters and 70 Unicode characters. In October 2026 the OneUptime project merged a fix after one curly quote, dash, or emoji switched alert texts to UCS-2 and multiplied the parts per page, then a second fix because a curly apostrophe or dash made subscriber texts cost two to three times as much. These are project reports rather than provider guarantees, and they show how small the trigger is.

A worked example across locales

Here is one reminder in several languages. The translations are illustrative, written for this test rather than taken from a product. We counted each string against the Unicode GSM 03.38 table, counting UCS-2 length in UTF-16 code units.

Version Encoding Characters Segments
English GSM-7 109 1
French, accented letters, straight punctuation GSM-7 130 1
French, same text with a non-breaking hyphen and a narrow space before ! UCS-2 131 2
French with a curly apostrophe in n’oubliez UCS-2 136 3
French, accented text decomposed (NFD) UCS-2 134 2
Spanish (clínica) UCS-2 126 2
Polish (Cześć, potwierdzić) UCS-2 125 2
German GSM-7 129 1

Three lessons come out of the table. Length alone tells you little. The 136-character French text costs three times as much as the 130-character one. A language that fits GSM-7 can still fall out of it because of punctuation. And for Spanish and Polish, the only way back to one segment is to shorten the text to 70 characters, change letters, or change the encoding scheme.

Typography is the hidden trigger

Translator and AI typography such as curly apostrophes, guillemets, dashes, and the French narrow no-break space can switch a translation to UCS-2 even when every letter fits GSM-7, so lint each locale's encoding and segment count.

This happens because good typography and SMS encoding pull in opposite directions. French typography conventionally puts a narrow no-break space (U+202F) before !, ?, :, and ;, and use guillemets around quotes. Professional translators and machine translation often produce curly apostrophes and real dashes. Word processors add them too: Optus warns that text pasted from documents can carry hidden characters outside the GSM set. None of these characters exists in GSM 03.38.

Providers try to help, and that is part of the confusion. Twilio says its Smart Encoding feature can replace characters such as curly quotes with GSM equivalents. Klaviyo's article on special and non-special SMS characters says it replaces curly quotes and guillemets automatically. Whether that happens depends on the provider, the account setting, and the channel, so a template that is one segment in one tool can be two in another.

What to do differently: decide an SMS typography policy per locale, separate from your web copy. For French SMS, that usually means straight apostrophes, no narrow space before punctuation, and straight quotes instead of guillemets. Give translators that policy in the string context. Then enforce it with a check rather than trusting review, because these characters look almost identical on screen.

Normalization and counter disagreements

Normalize templates to NFC before counting or sending, because decomposed accents force UCS-2 and vendor counters disagree on edge characters such as the GSM c-cedilla.

Unicode can write é as one code point or as e followed by a combining acute accent. UAX #15 defines NFC as the composed form and NFD as the decomposed one. The combining accent is not in GSM 03.38, so the decomposed form forces UCS-2 even though the composed letter is a GSM character. In the table above, the same French sentence went from one GSM-7 segment to two UCS-2 segments after decomposition. Text that passes through several tools can arrive in either form, and you cannot see the difference. Klaviyo notes that decomposed accented characters are counted differently, and a Hausa templates pull request in October 2026 counted characters after NFC for the same reason.

Counters also disagree at the edges. The Unicode mapping file notes that position 0x09 is mapped to small ç even though the ETSI glyph shows a capital, and Klaviyo lists ç among its special characters. Klaviyo's page also notes that lowercase à, è, ì, ò, and ù are GSM characters while the uppercase forms are not, so a capitalized word can change the encoding. Extension characters are another source of drift: €, [, ], {, }, |, ~, ^, and \ stay in GSM-7 but count as two characters, so a price line in euros is one character longer than it looks.

What to do differently: normalize to NFC when you import translations and again before you send. Count with the same table your provider uses, and when a provider reports the encoding it chose, store that value and compare it with your prediction.

Choose how each market handles non-GSM letters

For languages whose ordinary letters fall outside GSM-7, you have three choices.

Accept UCS-2 and write shorter. This keeps the text correct and readable. Budget 70 characters for a single message, or 67 per segment, and ask for short copy explicitly in the translation brief. This is the safest default for Greek, Cyrillic, Arabic, Asian scripts, Polish, and Czech.

Use a national language shift table. 3GPP TS 23.038 defines National Language Identifiers and single and locking shift tables for Turkish, Spanish, Portuguese, and several Indian languages; the ARIB transposition notes that Spanish has no locking shift table and falls back to the default alphabet. Infobip's multilingual SMS guide describes the practical result: with a national language table, a single Turkish, Spanish, or Portuguese message holds 155 characters, but support depends on carriers and handsets. A Stack Overflow question about SMPP shift tables shows how rarely this is exposed through ordinary APIs. Use it only where your provider supports it and you have tested real devices.

Transliterate. Replacing ł with l or ş with s keeps GSM-7. Infobip offers transliteration for several alphabets. It is cheap, but it can look careless, can change meaning, and is a poor fit for names and legal text. If you choose it, make it an explicit, reviewed per-locale setting and keep a native speaker in the loop, as the Hausa pull request above recommends for its AI-drafted templates.

Whatever you pick, tell the provider. Vonage's encoding guide asks you to set the type parameter to unicode for messages with characters outside the GSM sets, so a wrong flag affects delivery as well as cost.

Send verification codes in the user's language

Verification SMS language is picked by the provider from the phone number or device, not from the language the user chose in your app, so pass the app locale when the user has set one.

Twilio Verify resolves the language automatically from the country code of the phone number and falls back to English when no translation exists. It also accepts a locale parameter to override that choice. Twilio recommends the automatic resolution, which is reasonable when you know nothing else about the user. But a French speaker with a Swiss number, an English-speaking expat in Estonia, or a Canadian who chose French in your app all have a preference the phone number cannot see.

Firebase phone authentication has the same split. On the web you set auth.languageCode or call useDeviceLanguage(); on Apple platforms you set Auth.auth().languageCode; on Android you call setLanguageCode or useAppLanguage(). A Stack Overflow report describes verification texts arriving unreadable for Chinese and Japanese users, with the team forcing English as a workaround. That fixed readability for one group by removing the local language for everyone.

What to do differently: when a user has picked a language in your app, send that locale to the provider. If the provider does not support it, retry without the locale so the code still arrives, and log the gap. Remember that the provider's templates have their own encoding: a Czech or Greek code text may already be two segments.

Check SMS segments in CI

Count segments in your build pipeline, where every translation update runs through the same check. A minimal version looks like this:

import math
import unicodedata

GSM_BASIC = set(load_gsm_basic())       # from the GSM 03.38 mapping
GSM_EXTENSION = set(load_gsm_extension())  # counts as two septets

def sms_budget(text: str) -> dict:
    text = unicodedata.normalize("NFC", text)
    if all(c in GSM_BASIC or c in GSM_EXTENSION for c in text):
        units = sum(2 if c in GSM_EXTENSION else 1 for c in text)
        single, per_segment, encoding = 160, 153, "GSM-7"
    else:
        units = len(text.encode("utf-16-le")) // 2
        single, per_segment, encoding = 70, 67, "UCS-2"
    segments = 1 if units <= single else math.ceil(units / per_segment)
    offenders = sorted({c for c in text if c not in GSM_BASIC and c not in GSM_EXTENSION})
    return {"encoding": encoding, "units": units, "segments": segments, "offenders": offenders}

for template, locale, text in rendered_templates(sample_values="longest"):
    result = sms_budget(text)
    if result["segments"] > budget(template, locale):
        fail(template, locale, result)

Render each template with the longest realistic values for names, dates, amounts, and links, because personalization changes the count. Klaviyo's multinational sending basics points out that personalization and accented letters change the length per recipient, and its guide to crafting SMS notes that emoji and some special characters cut a segment from 160 to 70 characters. Report the offending characters with their code points, so a translator sees U+2019 instead of an invisible difference. The merezha pull request takes a similar approach with a configurable maximum segment count.

On Android, SmsMessage.calculateLength returns the number of messages and the code units used for a body, and SmsManager.divideMessage splits text the way the device will. For quick manual checks, Twilio's segment calculator shows which characters forced UCS-2. Questions on counting the SMS a message needs, checking for GSM-only text, and calculating parts in C# show the same logic in other languages.

Failure handling and tradeoffs

A template that fails the budget should not block a release silently. Choose a rule per template type. For marketing, fail the build and send the string back for a shorter translation. For verification codes and security alerts, allow an extra segment rather than delay delivery, but record it. For transactional texts, consider a shorter fallback string per locale.

Be careful with automatic replacement. Swapping curly quotes is harmless. Swapping letters is transliteration and changes the text the translator approved. Keep replacements in a reviewed per-locale list and run the check after replacement, so the number you test is the number you send.

Watch for drift after launch. Translators update strings, marketing adds emoji, and providers change defaults. Compare the encoding and segment count the provider reports for sent messages with your CI prediction, and alert when they differ.

Verify before you ship

  1. Render every SMS template in every locale with the longest sample values.
  2. Normalize to NFC, then compute encoding, units, and segments.
  3. List each non-GSM character with its code point and decide whether it is required by the language or introduced by typography.
  4. Compare the result with the segment budget for that template.
  5. Send one real message per locale through the provider and compare its reported segment count.
  6. For verification texts, test a user whose app language differs from the language of their phone number's country.

What to do next

Pick your three highest-volume SMS templates and run them through the check above in every language you send. If any locale is billed for more segments than English, start with typography and normalization, which are free to fix, before you cut words. If you translate Klaviyo flows, the i18nAgent Klaviyo integration translates SMS inside flows and validates character limits per language. Related guides cover push notification localization and counting text by grapheme cluster.