HOME

TheInfoList



OR:

In
mobile telephony Mobile telephony is the provision of telephone services to phones which may move around freely rather than stay fixed in one location. Telephony is supposed to specifically point to a voice-only service or connection, though sometimes the ...
GSM 03.38 or 3GPP 23.038 is a
character encoding Character encoding is the process of assigning numbers to graphical characters, especially the written characters of human language, allowing them to be stored, transmitted, and transformed using digital computers. The numerical values th ...
used in
GSM The Global System for Mobile Communications (GSM) is a standard developed by the European Telecommunications Standards Institute (ETSI) to describe the protocols for second-generation ( 2G) digital cellular networks used by mobile devices such a ...
networks for SMS (Short Message Service), CB (
Cell Broadcast Cell Broadcast (CB) is a method of sending messages to multiple mobile telephone users in a defined area at the same time. It is defined by the ETSI’s GSM committee and 3GPP and is part of the 2G, 3G, 4G LTE (telecommunication) and 5G sta ...
) and
USSD Unstructured Supplementary Service Data (USSD), sometimes referred to as "quick codes" or "feature codes", is a communications protocol used by GSM cellular telephones to communicate with the mobile network operator's computers. USSD can be used ...
(Unstructured Supplementary Service Data). The 3GPP TS 23.038 standard (originally GSM recommendation 03.38) defines GSM 7-bit default alphabet which is mandatory for GSM handsets and network elements,3GPP TS 23.038
Alphabets and language-specific information.
but the character set is suitable only for
English English usually refers to: * English language * English people English may also refer to: Peoples, culture, and language * ''English'', an adjective for something of, from, or related to England ** English national ide ...
and a number of Western-European languages. Languages such as Chinese, Korean or Japanese must be transferred using the 16-bit
UCS-2 The Universal Coded Character Set (UCS, Unicode) is a standard set of characters defined by the international standard ISO/IEC 10646, ''Information technology — Universal Coded Character Set (UCS)'' (plus amendments to that standard), wh ...
character encoding. A limited number of languages, like
Portuguese Portuguese may refer to: * anything of, from, or related to the country and nation of Portugal ** Portuguese cuisine, traditional foods ** Portuguese language, a Romance language *** Portuguese dialects, variants of the Portuguese language ** Por ...
, Spanish, Turkish and a number of languages used in
India India, officially the Republic of India ( Hindi: ), is a country in South Asia. It is the seventh-largest country by area, the second-most populous country, and the most populous democracy in the world. Bounded by the Indian Ocean on the ...
written with a
Brahmic scripts The Brahmic scripts, also known as Indic scripts, are a family of abugida writing systems. They are used throughout the Indian subcontinent, Southeast Asia and parts of East Asia. They are descended from the Brahmi script of ancient In ...
may use 7-bit encoding with ''national language shift table'' defined in 3GPP 23.038. For binary messages, 8-bit encoding is used.


GSM 7-bit default alphabet and extension table of 3GPP TS 23.038 / GSM 03.38

The standard encoding for GSM messages is the 7-bit default alphabet as defined in the 23.038 recommendation. Seven-bit characters must be encoded into octets following one of three packing modes: * CBS: using this encoding, it is possible to send up to 93 characters (packed in up to 82 octets) in one SMS message in a Cell Broadcast Service. * SMS: using this encoding, it is possible to send up to 160 characters (packed in up to 140 octets) in one SMS message in the GSM network. * USSD: using this encoding, it is possible to send up to 182 characters (packed in up to 160 octets) in one SMS message of Unstructured Supplementary Service Data. It is important (especially when a message is to be segmented using
concatenated SMS In the cellular phone industry, mobile phones and their networks sometimes support concatenated short message service (or concatenated SMS) to overcome the limitation on the number of characters Character or Characters may refer to: Arts, ente ...
mechanism) that characters from the Basic Character Set table take one septet, characters from the Basic Character Set Extension table take two septets. Note that the second part of the table is only accessible if the GSM device supports the 7-bit extension mechanism, using the ESC character prefix. Otherwise, the ESC code itself is interpreted as a space, and the following character will be treated as if there was no leading ESC code. Most of the high part of the table is not used in the default character set, but the GSM standard defines some language code indicators that allows the system to identify national variants of this part, to support more characters than those displayed in the above table. In a standard GSM text message, all characters are encoded using 7-bit code units, packed together to fill all bits of octets. So, for example, the 140-octet envelope of an SMS, with no other language indicator but only the standard class prefix, can transport up to (140*8)/7=160, that is 160 GSM 7-bit characters (but note that the ESC code counts for one of them, if characters in the high part of the table are used). Longer messages may be sent, but will require a continuation prefix and a sequence number on subsequent SMS messages (these prefix bytes and sequence number are counted within the maximum length of the 140-octet payload of the envelope format). When there are 1 to 6 spare bits in the last octet of a message, these bits are set to zero (these bits do not count as a character but only as a filler). When there are 7 spare bits in the last octet of a message, these bits are set to the 7-bit code of the CR control (also used as a padding filler) instead of being set to zero (where they would be confused with the 7-bit code of an '@' character). This 7-bit encoding allows the transport of texts consisting of printable characters from
Basic Latin (Unicode block) The Basic Latin or C0 Controls and Basic Latin Unicode block is the first block of the Unicode standard, and the only block which is encoded in one byte in UTF-8. The block contains all the letters and control codes of the ASCII encoding. It ...
(with the exception of the grave accent/backtick), as well as some characters of the ISO Latin 1 character set. It also allows the encoding of texts written in the Greek script, but only capitals; for such use in Greek, the Latin capital letters that look like the Greek letters are reused with the same code, so that the above character set is complete only for modern monotonic Greek restricted to capital letters. A complete support for the Greek alphabet (including small letters) requires a national version of the shifted 7-bit table (using the ESC code for each national character encoded in this shifted table), or an unspecified proprietary 8-bit encoding, or the use of the UCS-2 encoding (see below). Note that the special code marked ''SS2'' in the table above has also been assigned (and encoded as 0x1B,0x1B) to allow using another alternate 7-bit shift table. But this mechanism has never been used and the UCS-2 encoding has been preferred. Note that the character 0x09 (''Ç'', capital C with cedilla) should instead be replaced by ''ç'' (small c with cedilla) in modern implementation, as recommended by Unicode,GSM 03.38 to Unicode
GSM 03.38 to Unicode
since the uppercase version is of little use.


GSM 8-bit data encoding

8-bit data encoding mode treats the information as raw data. According to the standard, the alphabet for this encoding is user-specific.


UCS-2 Encoding

This encoding allows use of a greater range of characters and languages.
UCS-2 The Universal Coded Character Set (UCS, Unicode) is a standard set of characters defined by the international standard ISO/IEC 10646, ''Information technology — Universal Coded Character Set (UCS)'' (plus amendments to that standard), wh ...
can represent the most commonly used Latin and eastern characters at the cost of a greater space expense. Strictly speaking, UCS-2 is limited to characters in the
Basic Multilingual Plane In the Unicode standard, a plane is a continuous group of 65,536 (216) code points. There are 17 planes, identified by the numbers 0 to 16, which corresponds with the possible values 00–1016 of the first two positions in six position hexadecimal ...
. However, since modern programming environments do not provide encoders or decoders for UCS-2, some cell phones (e.g. iPhones) use
UTF-16 UTF-16 (16-bit Unicode Transformation Format) is a character encoding capable of encoding all 1,112,064 valid code points of Unicode (in fact this number of code points is dictated by the design of UTF-16). The encoding is variable-length, as c ...
instead of UCS-2. This works, because for characters in the Basic Multilingual Plane (including full alphabets of most modern human languages) UCS-2 and UTF-16 encodings are identical. To encode characters outside of the BMP (unreachable in plain UCS-2), such as
Emoji An emoji ( ; plural emoji or emojis) is a pictogram, logogram, ideogram or smiley embedded in text and used in electronic messages and web pages. The primary function of emoji is to fill in emotional cues otherwise missing from typed conver ...
, UTF-16 uses
surrogate pairs UTF-16 (16-bit Unicode Transformation Format) is a character encoding capable of encoding all 1,112,064 valid code points of Unicode (in fact this number of code points is dictated by the design of UTF-16). The encoding is variable-length, as cod ...
, which when decoded with UCS-2 would appear as two valid but unmapped code points. A single SMS GSM message using this encoding can have at most 70 characters (140 octets). Note that on many GSM cell phones, there's no specific preselection of the UCS-2 encoding. The default is to use the 7-bit encoding described above, until one enters a character that is not present in the GSM 7-bit table (for example the lowercase 'a' with acute: 'á'). In that case, the whole message gets reencoded using the UCS-2 encoding, and the maximum length of the message sent in a single SMS is immediately reduced to 70 characters, instead of 160. Others vary based on the choice and configuration of SMS application, and the length of the message. To avoid unexpected costs for senders that have a subscription for a limited pack of sent SMS, applications should display the number of character used and the maximum number of characters in the composed SMS. When a message exceeds this maximum, the message will be sent as multiple successive SMS containing parts of the message (each one containing a sequence number, which also uses a few leading characters in each part); these parts are intended to be reassembled later by the recipient. Some applications alert the user when a message will require splitting, or even send a longer message as a multimedia message (MMS).


National language shift tables

Since release 8 of the 3GPP 23.038 standard of March 2008, additional characters sets can be accessed through the use of a National Language Shift Tables. These tables allow using of different character sets according to the language the text is going to be written. The choice of table for a given message is selected in the User Data Header section of an SMS message and can be specified for the whole text (a ''Locking'' shift table replacing standard GSM 7-bit default alphabet table) or a single character (''Single'' shift table replacing the GSM 7-bit default alphabet extension table). ''Locking'' and ''Single'' shift tables together in the same message are possible, if both standard default alphabet table and default alphabet extension table are to be replaced. Using a shift table, a message can still use 7-bit encoding for the characters, but a different set can be chosen to correctly show accented and language specific characters. This allows up to 155 characters, encoded in 136 octets (140 octets, minus the 4-octets of User Data Header required to indicate the use of a shift table and the language code). With both ''Locking'' and ''Single'' shift tables, up to 152 characters are allowed, encoded in 133 octets (140 octets, minus 7-octets User Data Header). Characters from any locking shift table take one septet, characters from the single shift table (or Basic Character Set Extension table) take two septets. Initially, shift tables only for Turkish were specified; Spanish and Portuguese were added in later revisions of release 8. Release 9 introduced 10 languages used in India written with a
Brahmic scripts The Brahmic scripts, also known as Indic scripts, are a family of abugida writing systems. They are used throughout the Indian subcontinent, Southeast Asia and parts of East Asia. They are descended from the Brahmi script of ancient In ...
(Bengali, Gujarati, Hindi, Kannada, Malayalam, Oriya, Punjabi, Tamil, Telugu) and
Urdu Urdu (;"Urdu"
'' User Data Header to indicate the sequence number of each part). Although a revision of GSM 03.38 (as early as in version 4.0.1 of September 1994) has defined Data Coding Scheme values for
Cell Broadcast Cell Broadcast (CB) is a method of sending messages to multiple mobile telephone users in a defined area at the same time. It is defined by the ETSI’s GSM committee and 3GPP and is part of the 2G, 3G, 4G LTE (telecommunication) and 5G sta ...
System (CBS) for German, English, Italian, French, Spanish, Dutch, Swedish, Danish, Finnish, Norwegian, Greek and Turkish; with Hungarian, Polish, Czech, Hebrew, Arabic, Russian and Icelandic added in later revisions, no coding tables were defined for these languages. The purpose of this field was purely to identify the language of the message. There's also no language shift table for Japanese written in basic kanas, or for Korean written in Hangul jamos, or for Chinese written in the Han script. This is often not a problem in Japan, because it uses other standards than GSM and WAP for messaging. The two other languages also have too many distinct characters to fit into a 7-bit shift table.


Spanish language (Latin script)

There's no specific Locking Shift Character Set for the Spanish language. Uses the default Basic Character Set.


Portuguese language (Latin script)


Turkish language (Latin script)


Urdu language (Arabic and basic Latin scripts)

It may also be used for the
Sindhi language Sindhi ( ; , ) is an Indo-Aryan language spoken by about 30 million people in the Pakistani province of Sindh, where it has official status. It is also spoken by a further 1.7 million people in India, where it is a scheduled language, without ...
also written in the Arabic script. Sometimes it may be used for
Arabic language Arabic (, ' ; , ' or ) is a Semitic language spoken primarily across the Arab world.Semitic languages: an international handbook / edited by Stefan Weninger; in collaboration with Geoffrey Khan, Michael P. Streck, Janet C. E.Watson; Walter ...
as well, but the Eastern digits (encoded here in their Persian-Hindu variant) won't be used in that case because standard Arabic prefer its traditional Eastern Arabic digits, and will frequently be replaced by Western Arabic digits (encoded in the locking shift character set in column 0x30) which are also used now frequently in Urdu as well. However, in India, phones recognizing the Arabic language indication may substitute the Persian-Hindu variants of the Eastern Arabic digits by the traditional Eastern Arabic digits.


Hindi language (Devanagari and basic Latin scripts)


Bengali and Assamese languages (Bengali and basic Latin scripts)


Punjabi language (Gurmukhī and basic Latin scripts)


Gujarati language (Gujarati and basic Latin scripts)


Oriya language (Oriya and basic Latin scripts)


Tamil language (Tamil and basic Latin scripts)


Telugu language (Telugu and basic Latin scripts)


Kannada language (Kannada and basic Latin scripts)


Malayalam language (Malayalam and basic Latin scripts)


See also

* GSM 03.40 * User Data Header


References


External links


GSM 03.38 to Unicode
- the GSM 03.38 to Unicode mapping data file from unicode.org.
Text to GSM 03.38 in C#
- Text to GSM 03.38 mapping in the C# programming language.
JCharset - Java Charset package includes GSM 03.38 support
- JCharset - Java Charset package includes GSM 03.38 support.
Java regular expression for GSM 03.38
- Java regular expression for GSM 03.38 with code comments explaining the regex.
SMS Length Calculator
- Online SMS length calculator with character encoding highlighter.
International Components for Unicode (ICU), gsm-03.38-2009.ucm mapping file
{{DEFAULTSORT:Gsm 03.38 Character sets GSM standard