|
Hi,
I would like to ask what's the best way to send arabic unicode sms by email through Clickatell?
I am using this code but some of the characters are not showing properbly when the sms recieved:
private string ToUnicode(string val)
{
Encoding utf8 = Encoding.UTF8;
Encoding unicode = Encoding.Unicode;
byte[] utf8Bytes = utf8.GetBytes(val);
byte[] unicodeBytes = Encoding.Convert(utf8, unicode, utf8Bytes);
var result = ByteArrayToString(unicodeBytes);
result = result.Substring(result.Length - 2, 2) + result.Substring(0, result.Length - 2);
return result;
}
public static string ByteArrayToString(byte[] ba)
{
StringBuilder hex = new StringBuilder(ba.Length * 2);
foreach (byte b in ba)
hex.AppendFormat("{0:x2}", b);
return hex.ToString();
}
www.JassimRahma.com[^]
Technology News @ www.JassimRahma.com
modified 3-Dec-12 13:29pm.
|
|
|
|