title: Inserting Unicode to MSSQL via PHP
body: <p>I'm trying to insert Arabic language to mssql database. database column is set to nvarchar
  Data is posted through PHP to a mssql stored procedure.</p>
  
  <p>the problem is : data got inserted as <code>Þ‰ÞªÞ‡Þ°Þ‹Þ¦ÞŒÞª Þ‡Þ¨ÞÞ°ÞŒÞ¨Þ‡ÞªÞ‚Þ§ÞŠÞ° ÞŠÞ¯Þ‰Þ¬</code></p>
  
  <p>could any one please help me to get the correct data to be inserted without converting.</p>
  
  <pre><code>&gt;  &lt;?php header('Content-Type: text/html; charset=utf-8');  include_once
  &gt; 'connect.php';
  &gt; 
  &gt;   sqlsrv_query ($conn,"set character_set_client='utf8'");  
  &gt;   sqlsrv_query ($conn,"set character_set_results='utf8'"); 
  &gt;   sqlsrv_query ($conn,"set collation_connection='utf8_general_ci'");
  &gt;   
  &gt; 
  &gt; 
  &gt;    $tsql = 'Exec SP @NO=?,@Date=?,@IN=?,@creason=?';            
  &gt; $params = array($empno,$dutydate,$inDT,$outDT,$reason);
  &gt; 
  &gt;    $stmt = sqlsrv_query($conn,$tsql,$params) ;
  &gt;   
  &gt;        $dataArray = array();
  &gt;        if ($stmt === false)       {           echo 'SQL Error';           print_r(sqlsrv_errors());       }       else        {
  &gt;           
  &gt;           
  &gt;           
  &gt;               $dataArray['error'] =array();
  &gt;               while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {
  &gt;                   array_push($dataArray['error'],$row);
  &gt;               }
  &gt;               sqlsrv_free_stmt($stmt);
  &gt;               
  &gt;               }    echo json_encode($dataArray);
  &gt; 
  &gt; ?&gt;
  </code></pre>