Polish Characters Encoding

.NET library for SMPP protocol
Locked
stevep
Posts: 30
Joined: Wed May 02, 2007 7:41 pm

Polish Characters Encoding

Post by stevep » Wed Jan 09, 2013 11:42 am

Hi,

What is the best encoding method to send Polish characters to the handset. From research ISO88592 is the character set which contains the extended characters. I have tested with different encodings and I cannot see the character ó in my messages.

Steve
alt
Site Admin
Posts: 931
Joined: Tue Apr 25, 2006 9:45 am

Re: Polish Characters Encoding

Post by alt » Wed Jan 09, 2013 12:30 pm

Hi stevep,

It depends on how SMSC processes SMPP text.
GSM 03.38 has only character ò (0x08). I don't see ó there.
For russian we sometimes use data_codings 0x4.
In worst case you need to use UCS2 data coding.
stevep
Posts: 30
Joined: Wed May 02, 2007 7:41 pm

Re: Polish Characters Encoding

Post by stevep » Wed Jan 09, 2013 2:06 pm

Thank you for the reply.. I had a response from my carrier..
"ó is part of latin 1 (should be F3 in the table). So in theory you should be able to send it if you set data coding to 0x03"
I have tried Latin1 without success, is there some mapping to do?

Steve
alt
Site Admin
Posts: 931
Joined: Tue Apr 25, 2006 9:45 am

Re: Polish Characters Encoding

Post by alt » Wed Jan 09, 2013 2:41 pm

Please try code below

Code: Select all

client.MapEncoding(DataCodings.Latin1, Encoding.GetEncoding("iso-8859-2"));
stevep
Posts: 30
Joined: Wed May 02, 2007 7:41 pm

Re: Polish Characters Encoding

Post by stevep » Fri Jan 11, 2013 5:29 am

Thank you, I will try that.

Does that use 8bits for all characters or just the ones in 8859-2?

Just want to be sure not to go over 140 bytes.

Steve
alt
Site Admin
Posts: 931
Joined: Tue Apr 25, 2006 9:45 am

Re: Polish Characters Encoding

Post by alt » Tue Jan 15, 2013 1:31 pm

with this mapping client will send bytes array of the text encoded in 8859-2 when data_coding Latin1 is specified.
stevep
Posts: 30
Joined: Wed May 02, 2007 7:41 pm

Re: Polish Characters Encoding

Post by stevep » Mon Mar 04, 2013 4:05 pm

Hi Alt,

Does the enclosed look valid as it appears I am not able to send Polish characters. data is the

if (smsMessage.Body.DataCoding == DataCoding.et7bitText)
{
data.DataCoding = DataCodings.Default;
_smpp.MapEncoding(DataCodings.Default, new Inetlab.SMPP.Encodings.GSMEncoding());
}
else if (smsMessage.Body.DataCoding == DataCoding.etUCS2Text)
{
data.DataCoding = DataCodings.UCS2;
_smpp.MapEncoding(DataCodings.UCS2, System.Text.Encoding.BigEndianUnicode);
}
else if (smsMessage.Body.DataCoding == DataCoding.etISO88591)
{
data.DataCoding = DataCodings.Latin1;
_smpp.MapEncoding(DataCodings.Latin1, Encoding.GetEncoding("iso-8859-1"));
}
else if (smsMessage.Body.DataCoding == DataCoding.etISO88592)
{
data.DataCoding = DataCodings.Latin1;
_smpp.MapEncoding(DataCodings.Latin1, Encoding.GetEncoding("iso-8859-2"));
}

byte[] text_bytes = _smpp.GetMessageBytes(smsMessage.Body.Text.Value, data.DataCoding);
data.ShortMessageBytes = text_bytes;

Steve
stevep
Posts: 30
Joined: Wed May 02, 2007 7:41 pm

Re: Polish Characters Encoding

Post by stevep » Tue Mar 05, 2013 4:06 pm

I ask as with the settings above for ISO88592 I am still not able to send Polish characters.

Steve
alt
Site Admin
Posts: 931
Joined: Tue Apr 25, 2006 9:45 am

Re: Polish Characters Encoding

Post by alt » Tue Mar 05, 2013 4:44 pm

Hi Steve,

Does mobile phone support ISO88592?
Please ask SMSC again if they ever had success with Polish characters. Possible they convert text before sending to mobile phone.

With code above library should send 0xF3 for ó symbol in Latin1. We can make sure if you send me trace file.
alex111
Posts: 1
Joined: Thu Jan 30, 2014 10:33 am

Re: Polish Characters Encoding

Post by alex111 » Thu Jan 30, 2014 10:37 am

i use it its problematic...........




leather 4 sure
Locked