# The data coding scheme (DCS)

> 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.

- Canonical URL: https://www.broadnet.me/reference/data-coding-scheme-dcs
- Language: en
- Last updated: 2026-07-18
- Publisher: BroadNet (https://www.broadnet.me)

The data-coding scheme byte that tells the network how an SMS is encoded: GSM-7 (0x00), 8-bit (0x04), UCS-2 (0x08), plus message classes (0/flash to 3/SIM) from GSM 03.38.

## 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.

*Common data_coding / DCS values*

| 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.

*DCS coding-group structure (selected)*

| 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.

*SMS message classes*

| 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 questions

### 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.

## Sources

- [3GPP TS 23.038 — data coding scheme (§4)](https://www.3gpp.org/dynareport/23038.htm)
- [SMPP v3.4 specification — data_coding](https://smpp.org/SMPP_v3_4_Issue1_2.pdf)

## Related

- [The GSM-7 character set](https://www.broadnet.me/reference/gsm7-character-set)
- [UCS-2 and Unicode SMS](https://www.broadnet.me/reference/ucs2-unicode-sms)
- [SMPP submit_sm reference](https://www.broadnet.me/reference/smpp-submit-sm)
- [SMS segment calculator (free tool)](https://www.broadnet.me/tools/sms-segment-calculator)
- [A2P SMS product](https://www.broadnet.me/products/a2p-sms)
