I would like to send an SMS containing Emojis from my GSM Modem with AT Commands.
However, no matter which encoding I try, it never works (Encoding.BigEndianUnicode
, Encoding.Unicode
or Default
) make the SMS unreadable.
My code looks a bit like this:
// [..]
// send message with UCS2
command = "AT+CSCS=\"UCS2\"" + char.ConvertFromUtf32(13);
send(command);
// [..]
// convert my message (string from a WPF TextBox) to a unicode hex-string
byte[] ba = Encoding.BigEndianUnicode.GetBytes(message);
var hexString = BitConverter.ToString(ba);
hexString = hexString.Replace("-", "");
// send the converted string
command = hexString + char.ConvertFromUtf32(26);
send(command);
// [..]
The SMS successfully reaches its destination but the message is just some unreadable stuff.
Is this even possible to do? My GSM Modem would also support "HEX" as encoding.
Update: It kinda works if i replace this line:
command = hexString + char.ConvertFromUtf32(26);
With this:
command = "80 " + hexString + char.ConvertFromUtf32(26);
But then i get this 㣩 letter at the start of the message...