What is UCS-2 Character Encoding? (2024)

UCS-2 is a character encoding standard in which characters are represented by a fixed-length 16 bits (2 bytes). It is used as a fallback on many GSM networks when a message cannot be encoded using GSM-7 or when a language requires more than 128 characters to be rendered.

The Basics of UCS-2 Encoding and SMS Messages

the-basics-of-ucs-2-encoding-and-sms-messages page anchor

UCS-2 and the other UCS standards are defined by the International Organization for Standardization (ISO) in ISO 10646. UCS-2 represents a possible maximum of 65,536 characters, or in hexadecimals from 0000h - FFFFh (2 bytes). The characters in UCS-2 are synchronized to the Basic Multilingual Plane in Unicode.

Character is an overloaded term, so it is actually more correct to refer to code points. Code points allow abstraction from the character term, and are the atomic unit of storage of information in an encoding.

UCS-2 is a fixed-width encoding; each encoded code point will take exactly 2 bytes. As an SMS message is transmitted in 140 octets, a message which is encoded in UCS-2 has a maximum of 70 characters (really, code points): (140*8) / (2*8) = 70.

How Twilio Encodes Your Messages

how-twilio-encodes-your-messages page anchor

When sending SMS messages with Twilio, we'll automatically send messages in the most compact encoding possible. If you include any non GSM-7 characters in your message body, we will automatically fall back to UCS-2 encoding (which will limit message bodies to 70 characters each). Additionally, Twilio prepends a User Data Header of 6 Bytes (this instructs the receiving device on how to assemble messages), leaving 153 GSM-7 characters or 67 UCS-2 characters for your message.

Note that this may cause more messages to be sent than you expect - a body with 152 GSM-7-compatible characters and a single Unicode character will be split into 3 messages when encoded in UCS-2. This will incur charges for 3 outgoing messages against your account.

How Do I Check My Message Can Be Encoded in GSM-7?

how-do-i-check-my-message-can-be-encoded-in-gsm-7 page anchor

This page contains an interactive tool which can check if encoding your message in GSM-7 is possible, or if UCS-2 is needed.

How Can I Avoid My Messages Being Split When I Expect Them to be in GSM-7?

how-can-i-avoid-my-messages-being-split-when-i-expect-them-to-be-in-gsm-7 page anchor

Unfortunately, GSM-7 is not a supported character encoding in many text editors. Even setting encoding to ASCII (or US_ASCII) will not guarantee that text you write will be limited to GSM-7. You can use the above linked tool to quickly check the number of segments - that is, total messages - some text will be divided into.

If you are writing in an editor with Unicode support you'll need to be particularly careful. Text editors designed for writing might automatically add angled smart quotes, non-standard spaces, or punctuation which looks similar to GSM-7 but is a different Unicode character. We've discussed a few of these issues on our blog(link takes you to an external page).

Why is UCS-2 Used on the GSM Networks when GSM-7 is the Default Alphabet?

why-is-ucs-2-used-on-the-gsm-networks-when-gsm-7-is-the-default-alphabet page anchor

In some languages, more than 128 symbols are commonly used, so a larger universe of potential characters is needed. UCS-2 has been implemented in many GSM networks and on many mobile devices, and is considered the de facto standard fallback.

Is UCS-2 Encoding Obsolete?

is-ucs-2-encoding-obsolete page anchor

By the Unicode standard, UCS-2 is an obsolete encoding because it wasn't designed to allow characters in the so-called supplementary or 'astral' planes in Unicode. Plane 0, the Basic Multilingual Plane, contains character encodings for what are believed to be the most commonly used characters in modern languages. UCS-2 is limited to FFFFh code points, or 65,536 possible characters.

UTF-16 is the successor to UCS-2. And has the ability to address Base and 16 Supplementary planes, for a total maximum number of characters of 10FFFFh, or 1,114,112 code points.

Ready to Try Twilio Programmable SMS and SMS - With GSM-7 and UCS-2 Support?

ready-to-try-twilio-programmable-sms-and-sms---with-gsm-7-and-ucs-2-support page anchor

Sign up for a free Twilio trial account today(link takes you to an external page) - you'll have enough credit to explore the two major encodings we use, and a lot more.

More Information on UCS-2 Encoding and Twilio

more-information-on-ucs-2-encoding-and-twilio page anchor

  • How much does it cost to send a message with more than 160 characters?(link takes you to an external page)
  • Why are my messages with Unicode being split?(link takes you to an external page)
  • What the heck is a segment?(link takes you to an external page)
  • Adventures in Unicode SMS(link takes you to an external page)
  • Twilio REST API: Messages
What is UCS-2 Character Encoding? (2024)
Top Articles
HiPhi X und Z: Die Elektro-Elite aus China
Neuer Nissan Z (2022): Erste Testfahrt | autozeitung.de
Blorg Body Pillow
Lifewitceee
Steamy Afternoon With Handsome Fernando
Videos De Mexicanas Calientes
Hertz Car Rental Partnership | Uber
Retro Ride Teardrop
Kristine Leahy Spouse
craigslist: south coast jobs, apartments, for sale, services, community, and events
2021 Tesla Model 3 Standard Range Pl electric for sale - Portland, OR - craigslist
Robot or human?
Spelunking The Den Wow
Koop hier ‘verloren pakketten’, een nieuwe Italiaanse zaak en dit wil je ook even weten - indebuurt Utrecht
Evil Dead Rise Showtimes Near Regal Columbiana Grande
2 Corinthians 6 Nlt
Simplify: r^4+r^3-7r^2-r+6=0 Tiger Algebra Solver
Xsensual Portland
Myql Loan Login
Www Pointclickcare Cna Login
Yale College Confidential 2027
Hrconnect Kp Login
Stephanie Bowe Downey Ca
30+ useful Dutch apps for new expats in the Netherlands
Osrs Important Letter
Happy Shuttle Cancun Review
Account Now Login In
R/Sandiego
Fairwinds Shred Fest 2023
Craigslist Cars And Trucks Mcallen
Japanese Pokémon Cards vs English Pokémon Cards
Asian Grocery Williamsburg Va
Studentvue Columbia Heights
Banana Republic Rewards Login
Philadelphia Inquirer Obituaries This Week
Pokemon Reborn Locations
888-333-4026
T&Cs | Hollywood Bowl
Wunderground Orlando
Florida Lottery Claim Appointment
Lucyave Boutique Reviews
Fairbanks Auto Repair - University Chevron
Craigslist Binghamton Cars And Trucks By Owner
Movie Hax
Devotion Showtimes Near Showplace Icon At Valley Fair
Espn Top 300 Non Ppr
Tito Jackson, member of beloved pop group the Jackson 5, dies at 70
antelope valley for sale "lancaster ca" - craigslist
Definition of WMT
Ssss Steakhouse Menu
Gameplay Clarkston
Ff14 Palebloom Kudzu Cloth
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated:

Views: 6263

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.