Allow unicode messages through clickatell gateway
yhager - August 7, 2008 - 05:42
| Project: | SMS Framework |
| Version: | 5.x-1.x-dev |
| Component: | sms_clickatell.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
The attached patch (against HEAD) allows for sending unicode messages through clickatell.
Tested with Hebrew characters.
| Attachment | Size |
|---|---|
| yh.patch | 1.27 KB |

#1
I also tested this with arabic characters. I tried to test Japanese as well, but I think that my phone is the one limited here, and not the code.
#2
#3
This is an awesome idea!
The patch works, but looks like it forces all messages to be sent in two-byte Unicode, which cuts the maximum length of a text message in half to 70 characters. We need a way to conditionally switch on Unicode sending mode when it is needed so that message in germanic characters can be full length. Is it possible to detect special characters that need to be sent with Unicode?
#4
That's right.
UTF-8 encodes latin characters in the same way they are encoded traditionally. I used this fact to convert the text to latin, and then compare the resulting string with the original. If they are identical, this is latin text, if not, then we need unicode conversion.
I tested the attached patch using two strings: the first one being a 120 character pure English, the other one being (a shorter) Unicode. Both strings were sent correctly to the phone.
#5
Committed to HEAD. Thanks!
http://drupal.org/cvs?commit=134391
#6
Automatically closed -- issue fixed for two weeks with no activity.