diff options
author | Ben Chan <benchan@chromium.org> | 2017-12-15 00:45:12 -0800 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-12-18 10:21:29 +0100 |
commit | e8bac6cb9224083d445233baf2c1c4db1efe04ad (patch) | |
tree | 28af6fa27f3e38e6602206d5a672feaa8ca68cd2 /src/mm-sms-part-cdma.h | |
parent | c44b928206c1147bd760b4aef48294d7dda28e24 (diff) |
sms-part-3gpp: decode Unicode SMS with non-BMP code points
Depsite 3GPP TS 23.038 specifies that Unicode SMS messages are encoded in
UCS-2, UTF-16 encoding is commonly used instead on many modern platforms to
allow encoding code points that fall outside the Basic Multilingual Plane
(BMP), such as Emoji. Most of the UCS-2 code points are identical to their
equivalent UTF-16 code points. In UTF-16, non-BMP code points are encoded in a
pair of surrogate code points (i.e. a high surrogate in 0xD800..0xDBFF,
followed by a low surrogate in 0xDC00..0xDFFF). An isolated surrogate code
point has no general interpretation in UTF-16, but could be a valid (though
unmapped) code point in UCS-2.
This patch modifies the 3GPP SMS decoding to first try UTF-16BE and then fall
back to UCS-2BE on failure. If both fail, an empty string is returned
instead of a NULL pointer.
Diffstat (limited to 'src/mm-sms-part-cdma.h')
0 files changed, 0 insertions, 0 deletions