I'm am working with bulk SMS application. It works fine, but when I send a message with Unicode characters, my mobile shows it as ????????.
I am using a XML file that contains URL, numbers and message body.
The code I have is this:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
request.Method = "POST";
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] byteArray = Encoding.UTF8.GetBytes(xml);
string text = Encoding.UTF8.GetString(byteArray);
request.ContentType = "text/xml; encoding='utf-8'";
request.UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome / 41.0.2228.0 Safari / 537.36";
request.Accept = "text/xml,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
WebResponse response = (HttpWebResponse)request.GetResponse();
if (response.ContentLength > 0)
{
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
dataStream = response.GetResponseStream();
using (StreamReader reader = new StreamReader(dataStream))
{
returnValue = reader.ReadToEnd();
}
}
else
{
returnValue = "ERROR" + " " + "No Response From Jasmin";
}
Console.WriteLine(returnValue);
dataStream.Close();
response.Close();
Hope you guys give me a solution to this?