Scandinavian characters in incoming messages

Post Reply
grbrandt
Posts: 3
Joined: Fri Jun 03, 2022 8:46 am

Scandinavian characters in incoming messages

Post by grbrandt » Fri Jun 03, 2022 12:12 pm

I am experiencing this weird behavior where sending and receiving SMS from my application via a Norwegian SMSC works fine except Norwegian characters seems to be incorrectly encoded on reception.
I am kinda starting to suspect that it is the Android phone I am using to test this with that is doing something wrong, but I would appreciate someone elses opinion.

I have not mapped any encoder, nor set any special setting related to character set.
  • When sending the characters "ÆØÅ" to a mobile device, the user data in the SubmitSm request contains the bytes (in decimal): 28,11,14. This is correct according to GSM 03.38 7 bit character set.
  • When sending the same characters from said mobile device back to the server, the user data in DeliverSm contains the bytes (in decimal) 198,216,197. This corresponds to the character encoding of the extended ASCII set, for example ISO-8859-1.
  • When sending messages from the server I specify DataCoding=Default in the builder, but for incoming messages I am not manually setting anything.

    When receiving a message Inetlab.SMPP detects Default as the datacoding unless I add an emoji to the message before sending it from the mobile phone, Inetlab.SMPP correctly detects that the DataCoding is UCS2 and the message text is decoded to the correct scandinavian characters.
What (or where) is going wrong here? I don't think it is the SMPP component, but perhaps I could get around this problem somehow? I do not need to support any other character set than Latin/Western Europe.

Appreciate any input here, thanks!
grbrandt
Posts: 3
Joined: Fri Jun 03, 2022 8:46 am

Re: Scandinavian characters in incoming messages

Post by grbrandt » Fri Jun 03, 2022 12:19 pm

UPDATE:
One way of fixing it in this particular test is to specify a different mapper for the SMPP receiver, and this line works:

Code: Select all

Client.EncodingMapper.MapEncoding(DataCodings.Default, Encoding.Latin1);
But, this of course only works as long as the sender does not use the 7-bit GSM alphabet. Or?
Can I somehow detect this?
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Scandinavian characters in incoming messages

Post by alt » Mon Jun 06, 2022 5:05 pm

Hi,

What value has data_coding field in the DELIVER_SM PDU?
I would use the same data_coding in the SUBMIT_SM PDU and set appropriate .NET Encoding in the EncodingMapper for the client.

https://docs.inetlab.com/smpp/v2.9/arti ... oding.html
grbrandt
Posts: 3
Joined: Fri Jun 03, 2022 8:46 am

Re: Scandinavian characters in incoming messages

Post by grbrandt » Tue Jun 07, 2022 1:40 am

Hi,

The DataCoding property in the DeliverSm PDU is Default. I already specify the same for the SubmitSm.
Could it be that the SMSC is not following the specs or that the Android phone is not?
Post Reply