Andy Grove's Blog

Sending extended character sets with OpenSMPP

Friday, 4 January 2008

There's astonishingly little documentation on the web about sending international characters in SMS messages using OpenSMPP (which is based on the Logica SMPP API). After a bit of research and some experimentation I've established that the following steps are required:

1. data_coding must be set to 0x08 (instructs the SMSC to use UCS-2 encoding - see section 5.2.19 in the SMPP protocol specification for other data codings)
2. When setting the message content, it must be encoded with UTF16

Here's some partial source code to demonstrate the point:

SubmitSM request = new SubmitSM();
request.setDataCoding( 0x08 ); // UCS-2
request.setShortMessage( messageText, Data.ENC_UTF16 );

It's worth noting that the maximum message length is reduced from 160 characters to 70 characters when using UCS-2.

5 Comments:

Blogger Thiam Teck said...

I have a question, the 'messageText' shall be UCS2 hex or actual content?

18 April 2008 04:08  
Blogger Andy Grove said...

It should be the actual content. There's no need to hex encode it.

18 April 2008 09:18  
Blogger Bousri said...

Can you please tell me which encoding i use to send SMS contains special characters (like é à ù )and its length is more than 70 C.

04 June 2008 16:45  
Blogger raza said...

Hi andy,

I also want to know how we can send international SMS with length more then 70.

Regards

27 June 2008 09:13  
Anonymous Mimi said...

How about umlaut characters ? I tried to send with opensmpp and they're displayed as question marks. Referring to this page:
http://www.visualgsm.com/bit_default_alphabet.htm

It said that umlaut is already included in 7 bit SMS encoding.

22 October 2008 05:59  

Post a Comment

<< Home