我正在使用JamaaTech SMPP库将SMS从我的SMSC提供商发送到移动设备。我想发送阿拉伯语短信,但我在手机上收到中文字母。以下是我的代码。
SmppClient client = new SmppClient();
SmppConnectionProperties properties = client.Properties;
properties.SystemID = "XXX";
properties.Password = "XXX";
properties.Port = XXXX;
properties.Host = "XXX.XXX.XXX.XXX";
properties.SourceAddress = "XXXXXXXXXX";
properties.DefaultEncoding = DataCoding.UCS2;
//Resume a lost connection after 30 seconds
client.AutoReconnectDelay = 3000;
//Send Enquire Link PDU every 15 seconds
client.KeepAliveInterval = 15000;
//Start smpp client
client.Start();
while (client.ConnectionState != SmppConnectionState.Connected)
Thread.Sleep(100);
var msg = new TextMessage();
msg.DestinationAddress = "XXXXXXXXXXX";
msg.SourceAddress = "XXXXXXXXXX";
msg.Text = "س";
msg.RegisterDeliveryNotification = true;
client.SendMessage(msg);
我真的厌倦了尝试不同的解决方案并在谷歌搜索。如果有人能帮助我,我真的很感激。
答案 0 :(得分:0)
中文消息应该由unicode编码。