xi-project/xi-sms

Unicode messages with Infobip

Opened this issue · 0 comments

Currently messages sent with Infobip do not support UFT-8.

According to the Infobip API specification

UNICODE messages can be sent either by converting message text into hexadecimal representation and inserting that content into binary tag or by inserting unconverted UNICODE text into text tag. In case when you’re inserting unconverted UNICODE text you have to relay “Content-Encoding:UTF-8” information in the header when submitting messages using HTTP POST. No matter which method you use to submit UNICODE messages you always have to set DataCoding=8 parameter.

The DataCoding parameter is hardcoded to 3 in InfobipGateway.php line 76. In addition to that, the text is decoded on line 80 in the same file.

By modifying the file file (DataCoding to 8 and removing the utf8_decode function call) unicode messages are sent successfully. However, it might be useful to let the user choose which method to use - because of this I have not submitted this as a pull request.