Кодировка кириллицы для отправки SMS через GSM модем

1,00
р.
Отправляю смс, получаю набор символов. Пытался sp.Encoding = UTF8Encoding.Default - тоже самое. С англ текстом промблем нету.
public static string SMSMessage = "привет" public static string CellNumber = "+77777777"
private void Form1_Load(object sender, EventArgs e) { sp = new SerialPort() sp.PortName = "COM12" sp.Encoding = UTF8Encoding.UTF8 }
private void button1_Click(object sender, EventArgs e) { try { if (!sp.IsOpen) { sp.Open() this.sp.WriteLine(@"AT" + (char)(13)) Thread.Sleep(200) this.sp.WriteLine("AT+CMGF=1" + (char)(13)) Thread.Sleep(200) this.sp.WriteLine(@"AT+CMGS=""" + CellNumber + @"""" + (char)(13)) Thread.Sleep(200) this.sp.WriteLine(SMSMessage + (char)(26)) } } catch (Exception ex) { MessageBox.Show(string.Format("Exception : {0}", ex.Message), "Port Error") } }

Ответ
Решил проблему. Кодировка нужна - UCS2
this.WriteLine("AT+CSMP=17,167,0,25" + (char)(13)) Thread.Sleep(200) this.sp.WriteLine(StringToUCS2("Привет, привіт !@#%") + char.ConvertFromUtf32(26))

public static string StringToUCS2(string str) { UnicodeEncoding ue = new UnicodeEncoding() byte[] ucs2 = ue.GetBytes(str)
int i = 0 while (i < ucs2.Length) { byte b = ucs2[i + 1] ucs2[i + 1] = ucs2[i] ucs2[i] = b i += 2 } return BitConverter.ToString(ucs2).Replace("-", "") }
Все работает на ура! :)