User Tools

Site Tools

DataCodings to .NET encoding mapping

For each SmppClient instance you can define which System.Text.Encoding will be used for specified Inetlab.SMPP.Common.DataCodings.

//Set GSM Packed Encoding for data_coding Latin1 (0x3)
client.MapEncoding(DataCodings.Latin1, new Inetlab.SMPP.Encodings.GSMPackedEncoding());

By default SmppClient has following data_coding to Encoding mappings:

client.MapEncoding(DataCodings.Default, new Inetlab.SMPP.Encodings.GSMEncoding());
client.MapEncoding(DataCodings.UCS2, System.Text.Encoding.BigEndianUnicode);
client.MapEncoding(DataCodings.UnicodeFlashSMS, System.Text.Encoding.BigEndianUnicode);

Before change mapping settings please clarify what encoding is expected for data_coding value with SMSC technician.

National Language tables

These tables allow using of different character sets in SMS messages. You choose the language by adding User Data Header. There is ability to replace standard GSM 7 bit default alphabet table for whole text (Locking shift table) or only extension table (Single shift table). Code bellow shows ways how you can specify desired character set:



  submitSm.UserDataPdu.Headers.Add(new NationalLanguageSingleShift(NationalLanguage.Spanish));
  submitSm.UserDataPdu.Headers.Add(new NationalLanguageLockingShift(NationalLanguage.Turkish));

Library is also able to detect national language User Data Header in received PDU and show text with correct character set within property MessageText.

Page Tools