Today we had to modify vtiger to allow users to send sms in language other than english, after lot of research we were able to get this done
When sending sms through clickatell, you need to convert the message string to a UNICODE characters before submitting to the gateway. Because clickatell has its own unicode convertor.
So we added following function to modules/SMSNotifier/providers/clickatell.php
then converted the message string passed in send function as follows
you also have to pass unicode parameter to your message as follows
When sending sms through clickatell, you need to convert the message string to a UNICODE characters before submitting to the gateway. Because clickatell has its own unicode convertor.
So we added following function to modules/SMSNotifier/providers/clickatell.php
public function hex_chars($data){ $mb_hex = ''; for($i = 0 ; $i<mb_strlen($data,'UTF-8') ; $i++){ $c = mb_substr($data,$i,1,'UTF-8'); $o = unpack('N',mb_convert_encoding($c,'UCS-4BE','UTF-8')); $mb_hex .= sprintf('%04X',$o[1]); } return $mb_hex; }
then converted the message string passed in send function as follows
$params['text'] = $this->hex_chars($message);
you also have to pass unicode parameter to your message as follows
$params['unicode'] = 1;