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.

AttachmentSize
yh.patch1.27 KB

#1

yhager - August 7, 2008 - 11:04

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

yhager - August 7, 2008 - 11:05
Status:active» needs review

#3

Will White - August 7, 2008 - 18:39
Status:needs review» needs work

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

yhager - August 11, 2008 - 04:55
Status:needs work» needs review

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.

AttachmentSize
yh.patch 1.48 KB

#5

Will White - August 17, 2008 - 15:09
Status:needs review» fixed

Committed to HEAD. Thanks!

http://drupal.org/cvs?commit=134391

#6

Anonymous (not verified) - August 31, 2008 - 15:12
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.