3

I have CiviCRM 5.13 on Drupal7 with the clickatell v4.1 extension for SMS. Clickatell integration works, I can send test SMS via HTTPS from the browser to test phones. Database and environment is set to UTF-8.

However, if a mass SMS is compiled in https://example.com/civicrm/sms/send?reset=1, or a direct SMS is sent, the non-English characters, like é,á,... are lost or transformed in the SMS body. If the same text is sent over HTTPS/curl directly to Clickatell, there is no such issue.

Is it a CiviCRM issue, or a misconfiguration on my side? How can I track it down?

1 Answer 1

4

I suspect the unicode issue arises from the clickatell extension. It uses the utf8_decode() function to decode the message text from a UTF-8 string to ISO-8859-1 before posting to Clickatell. Hence Clickatell manages UTF-8 messages, the use of utf8_decode() is not necessary, and removing it resolves my issue above.

Replace original code:

$postDataArray['text'] = utf8_decode(substr($message, 0, 460)); // max of 460 characters, is probably not multi-lingual
$postDataArray['content'] = utf8_decode(substr($message, 0, 460)); // max of 460 characters, is probably not multi-lingual

to this one:

$postDataArray['text'] = substr($message, 0, 460); // max of 460 characters, is probably not multi-lingual
$postDataArray['content'] = substr($message, 0, 460); // max of 460 characters, is probably not multi-lingual

I'll provide a patch to Clickatell extensions, if this solution gets confirmed by the community.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.