title: Decrypt/Decrypt Arabic string
body: <p>How to encrypt/decrypt arabic text in C#</p>
  
  <pre><code>    public static string Encrypt(string pDataToEncrypt)
      {
  
          ASCIIEncoding textConverter = new ASCIIEncoding();
          RijndaelManaged myRijndael = new RijndaelManaged();
          byte[] toEncrypt;
  
          ICryptoTransform encryptor = myRijndael.CreateEncryptor(key, IV);
  
          MemoryStream msEncrypt = new MemoryStream();
          CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor,            CryptoStreamMode.Write);
  
          toEncrypt = textConverter.GetBytes(pDataToEncrypt);
  
          csEncrypt.Write(toEncrypt, 0, toEncrypt.Length);
          csEncrypt.FlushFinalBlock();
  
          return Convert.ToBase64String(msEncrypt.GetBuffer(), 0, (int)msEncrypt.Length);
      }
  
      public static string Decrypt(string pDataToDecrypt)
      {
          RijndaelManaged myRijndael = new RijndaelManaged();
          byte[] fromEncrypt;
  
          //Encoding asciiEncoding = Encoding.ASCII;
  
          fromEncrypt = Convert.FromBase64String(pDataToDecrypt);
          ICryptoTransform decryptor = myRijndael.CreateDecryptor(key, IV);
  
          MemoryStream msDecrypt = new MemoryStream(fromEncrypt, 0, fromEncrypt.Length);
          CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read);
          StreamReader sr = new StreamReader(csDecrypt);
  
          return sr.ReadToEnd();
  
      }
  </code></pre>
  
  <p>when i try to encrypt its return "????" question marks</p>
  
  <p>thanks in advance  </p>