title: PDU GSM 7bit Encoding
body: <p>working on C# project and Huawei E1550 modem to send USSD codes using +CUSD command</p>
  
  <p>after a lot of research and try and error i discovered that i should send the command encoded using "GSM 7bit" </p>
  
  <p>i found online converter that do that : <a href="http://smstools3.kekekasvi.com/topic.php?id=288" rel="nofollow">http://smstools3.kekekasvi.com/topic.php?id=288</a></p>
  
  <p>so i search to find class/algorithm to implement it using c# and i find this : <a href="https://sites.google.com/site/freesmsuk/gsm7-encoding" rel="nofollow">https://sites.google.com/site/freesmsuk/gsm7-encoding</a></p>
  
  <p>the problem is if i encode one character only it encode it correctly "1" --> "31"</p>
  
  <p>but when i encode string "*888#" the online converter generates "2A1C0E3702" while the class generates "2A38383823"</p>
  
  <p>and the modem processed the online encoding not the class </p>
  
  <p>what's the wrong with the algorithm? thanks in advance </p>