title: How to convert string encoded in windows-1250 to unicode?
body: <p>I am receiving from some dll (which is wrapper for some external data source) strings in Windows-1250 codepage and I would like to insert them correctly (as unicode) to table in SQL Server Database. Since particular row in database which should hold that data is of NVarchar type, I only needed to convert it in my C# code to unicode and pass it as parameter. Everything is well and nice, but I stumbled on conversion step.</p>
  
  <p>I tried the following but that doesn't work:</p>
  
  <pre><code>private static String getUnicodeValue(string string2Encode) //
  {
      Encoding srcEncoding = Encoding.GetEncoding("Windows-1250");
      UnicodeEncoding dstEncoding = new UnicodeEncoding();
      byte[] srcBytes =  srcEncoding.GetBytes(string2Encode);
      byte[] dstBytes = dstEncoding.GetBytes(string2Encode);
      return dstEncoding.GetString(dstBytes);
  }
  </code></pre>
  
  <p>When I insert this returned string to table, I don't get correct letters like Đ, đ, Č, č, Ć or ć.</p>
  
  <p>Please, help! :)</p>