The data coding scheme (DCS) is a one-octet field — data_coding in SMPP, TP-DCS in GSM — that tells the network how the message body is encoded and, optionally, its message class. The three values that matter are 0x00 (GSM-7 default), 0x04 (8-bit binary) and 0x08 (UCS-2/Unicode). Higher coding groups add message-class and flash behaviour.
The three values you use daily
For almost all A2P text traffic, the DCS is one of three values. 0x00 selects the GSM-7 default alphabet. 0x04 selects 8-bit binary (used for OTA, WAP push and other data payloads, not human text). 0x08 selects UCS-2 for Unicode. Setting the wrong value causes mojibake and mis-segmentation, so it must match how you actually encoded short_message.
| Value | Encoding | Use |
|---|---|---|
| 0x00 | GSM-7 default alphabet | Standard Latin text SMS |
| 0x01 | IA5 / ASCII | Rarely used |
| 0x03 | Latin-1 (ISO-8859-1) | Some Western-European routes |
| 0x04 | 8-bit binary | Binary / OTA / WAP push payloads |
| 0x08 | UCS-2 (UTF-16BE) | Unicode / non-Latin / emoji |
The GSM 03.38 coding groups
The DCS octet is not a flat enumeration — its high nibble selects a coding group that reinterprets the low bits. The general data-coding group (0x0X) carries an alphabet indicator (bits 3-2: 00 = GSM-7, 01 = 8-bit, 10 = UCS-2) and an optional compression and class flag. The data-coding/message-class group (0xFX) is used for immediate-display 'flash' messages.
| High nibble | Group | Low bits meaning |
|---|---|---|
| 0x0X | General data coding | Alphabet (GSM-7/8-bit/UCS-2), compression, class flag |
| 0x1X | General, class present | As above with message class in bits 1-0 |
| 0xCX | Message waiting — discard | Voicemail/indicator groups |
| 0xDX / 0xEX | Message waiting — store | GSM-7 / UCS-2 indicator groups |
| 0xFX | Data coding / message class | Alphabet in bit 2, class in bits 1-0 (flash = class 0) |
Message classes
When the DCS indicates a message class, bits 1-0 select where the message lands. Class 0 is a 'flash' SMS shown immediately on screen without being stored. Class 1 targets the handset (ME), class 2 the SIM (SIM Toolkit / OTA), and class 3 external terminal equipment. Most A2P text carries no class; flash (class 0, e.g. DCS 0xF0 for GSM-7) is used for alerts that must appear instantly.
| Class | Destination | Behaviour |
|---|---|---|
| Class 0 | Screen | Flash — displayed immediately, not auto-stored |
| Class 1 | Mobile equipment (ME) | Stored in handset memory |
| Class 2 | SIM | SIM Toolkit / OTA provisioning |
| Class 3 | Terminal equipment (TE) | Forwarded to external equipment |
Frequently asked
What is the data coding scheme in SMS?
It is a one-octet field (data_coding in SMPP, TP-DCS in GSM) that tells the network how the message body is encoded — GSM-7, 8-bit or UCS-2 — and optionally its message class. It must match how the payload was actually encoded.
What data_coding value do I use for GSM-7 vs Unicode?
Use 0x00 for GSM-7 default-alphabet text and 0x08 for UCS-2 Unicode. Use 0x04 only for 8-bit binary payloads like OTA or WAP push, never for human-readable text.
What is a flash SMS?
A flash SMS is a class 0 message that appears immediately on the recipient's screen without being saved to the inbox. It is set via the message-class bits of the DCS (for example 0xF0 for GSM-7 flash).
Why did my message arrive as garbled characters?
Almost always a DCS mismatch: the data_coding value did not match the actual encoding of short_message. For example, sending UTF-16 bytes with data_coding 0x00 (GSM-7) produces mojibake. Set data_coding to match the bytes you send.
Source specifications
The published standards this page is grounded in. Opens in a new tab.