Why use smart encoding
SMS messages using GSM-7 encoding fit 160 characters per segment. When a message contains even one Unicode character outside GSM-7, the entire message switches to UTF-16 encoding, which only fits 70 characters per segment. A single smart quote (") or em dash (—) can more than double your messaging costs.
Example:
How it works
When smart encoding is enabled:- Your message text is scanned for Unicode characters that have GSM-7 equivalents.
- Matching characters are automatically replaced (e.g.,
"→",—→-,…→...). - The final encoding (GSM-7 or UTF-16) is determined after all substitutions.
- The segment count is recalculated based on the transformed text.
- The API response includes metadata about the transformation.
text field in delivery webhooks contains your original message, not the smart-encoded version. This ensures your application’s message tracking stays consistent.Enable smart encoding
You can enable smart encoding at two levels: on a messaging profile (applies to all messages) or on a per-request basis.On a messaging profile
Enable smart encoding as a default for all messages sent through a profile.- API
- Portal
Per-request control
Override the profile setting on individual messages using theencoding parameter:
encoding parameter takes precedence over the messaging profile’s smart_encoding setting.Response metadata
When smart encoding is applied, the API response includes detailed metadata:parts field in the top-level response reflects the segment count after smart encoding, so you always see the actual billing impact.Checking the response
Precedence rules
Smart encoding behavior is determined by a combination of your messaging profile setting and the per-requestencoding parameter:
encoding parameter always takes precedence over the messaging profile setting.Character substitutions
Smart encoding replaces 200+ Unicode characters with GSM-7 equivalents. The tables below show all supported substitutions grouped by category.Quotation marks
Quotation marks
Apostrophes and single quotes
Apostrophes and single quotes
Dashes and hyphens
Dashes and hyphens
Slashes and division
Slashes and division
Backslashes
Backslashes
Underscores and vertical lines
Underscores and vertical lines
Symbols and punctuation
Symbols and punctuation
Commas
Commas
Parentheses and brackets
Parentheses and brackets
Asterisks
Asterisks
Math, comparison, periods, and colons
Math, comparison, periods, and colons
Fullwidth digits
Fullwidth digits
Fullwidth and small capital letters
Fullwidth and small capital letters
Greek letters
Greek letters
Tildes and circumflex
Tildes and circumflex
Whitespace characters
Whitespace characters
Control characters
Control characters
Edge cases
Message length increases
Message length increases
- Horizontal ellipsis (
…) becomes three periods (...) — adds 2 characters - Tab (U+0009) becomes 7 spaces — adds 6 characters
- Vulgar fractions like
½become1/2— adds 2 characters
Mixed replaceable and non-replaceable characters
Mixed replaceable and non-replaceable characters
Extended GSM-7 characters
Extended GSM-7 characters
~, ^, |, \, {, }, [, ] are part of the GSM-7 extended set and count as 2 characters each when calculating segment length. Smart encoding accounts for this when determining the final segment count.Zero-width characters and empty messages
Zero-width characters and empty messages
400 error — messages cannot be empty after transformation.encoding=gsm7 with non-convertible characters
encoding=gsm7 with non-convertible characters
encoding=gsm7 on a request but the message contains characters that cannot be represented in GSM-7 (e.g., emoji), the API returns a 400 error rather than silently dropping characters.Limitations
- SMS only — MMS and RCS use UTF-8 encoding by default and are not affected by smart encoding.
- Not all characters convert — Emojis and non-Latin scripts (e.g., Chinese, Arabic, Cyrillic) have no GSM-7 equivalents and will still trigger UTF-16 encoding.
- Visual differences — Substitutions may slightly alter the appearance of your message. Review the character tables above to understand what changes will occur.
- Length may increase — Some substitutions produce longer output (e.g.,
…→...). Always check the response metadata for the actual segment count.