Click here to Skip to main content
15,889,527 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
I will send persian sms with gsm modem in C#, i have a problem, when i send a message, text message isnt correct, forexample textmessage = 'سلام', i recived '????'
please help me. Tanks.
Posted
Updated 13-Mar-16 20:13pm
Comments
Sandeep Mewara 8-Sep-12 3:55am    
Receiving device has the needed locale installed?
Shaunak De 8-Sep-12 9:20am    
If you are able to receive other text messages in Persian on the receiving device, then you need to check the modem.
Mohammad Reza Valadkhani 14-Mar-16 5:39am    
I can help you about that, you need to send message as PDU format.

1 solution

use utf8 to encoding when you recived bytes ...
 
Share this answer
 
Comments
RajabzadehSara 13-Sep-12 6:58am    
Tanks.
Please change my code,


my send code is :

myport.BaudRate = 921600;
myport.Parity = Parity.None;
myport.StopBits = StopBits.One;
myport.DataBits = 8;
myport.ReadBufferSize = 10000;
myport.ReadTimeout = 1000;
myport.WriteBufferSize = 10000;
myport.WriteTimeout = 10000;
myport.RtsEnable = true;

if (txtTel.Text.Trim() != "")
{ try
{
if (!myport.IsOpen)
myport.Open();

myport.DiscardOutBuffer();
myport.DiscardInBuffer();

myport.WriteLine("AT+CMGF=1\r");
myport.WriteLine("AT+CMGS=\""+txtTel.Text.Trim()+"\"\r");
myport.WriteLine(txtMessage.Text.Trim() + '\x001a');


Thread.Sleep(500);
if (myport.ReadExisting().Contains("ERROR"))
MessageBox.Show("Device does not support this command or any other problem...");
else {
MessageBox.Show("Sent successfully", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
} myport.DiscardOutBuffer();
} catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
myport.Close();
}
}
else
{
MessageBox.Show("Enter Tel"); txtTel.Focus();
}
ali_heidari_ 13-Sep-12 9:25am    
does your mobile support persian?
gallant2007 18-Oct-12 3:26am    
شما باید در مود تکست نباشید

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900