praekeltfoundation / vumi

Messaging engine for the delivery of SMS, Star Menu and chat messages to diverse audiences in emerging markets and beyond.
BSD 3-Clause "New" or "Revised" License
421 stars 131 forks source link

GSM7Bit SMPP codec should be able to fallback to UCS2. #838

Open smn opened 10 years ago

smn commented 10 years ago

This comes out of #836.

Wikipedia says:

Note that on many GSM smartphones, there's no specific preselection of the UCS-2 encoding. 
The default is to use the 7-bit encoding above, until one enters a character that is not present 
in the GSM 7-bit table (for example the lowercase c with cedilla 'ç'). In that case, the whole 
message gets reencoded using the UCS-2 encoding, and the maximum length of the message 
sent in only 1 SMS is immediately reduced to 70 code units, instead of 160.

This results in some MNOs sending us UCS2 data without changing the data coding value that's been communicated as being GSM 7bit.

Without a fall back we then wouldn't be able to decode the message and respond with an ESME_RDELIVERYFAILURE or something similar.

smn commented 10 years ago

In practice, we've also seen MNOs send us stuff in ISO-8859-2 / latin2 when it's not available in the gsm0338 alphabet.