title: PHP/PDO and SQL Server connection and i18n issues
body: <p>In our web-app we use PHP5.2.6 + PDO to connect to a SQL Server 2005 database and store Russian texts.</p>
  
  <p>Database collation is <code>Cyrillic_General_CI_AS</code>, table collation is <code>Cyrillic_General_CI_AS</code>, column type is <code>NVARCHAR(MAX)</code>.</p>
  
  <p>We tried connecting to a database using two following schemes, both causing different problems.</p>
  
  <ol>
  <li><p><em>PDO mssql:</em></p>
  
  <pre><code>$dbh = new PDO ('mssql:host='.$mssql_server.';dbname='.$mssql_db, $mssql_login, $mssql_pwd);
  </code></pre>
  
  <p>in which case a result of a simple query like that:</p>
  
  <pre><code>SELECT field1 FROM tbl1 WHERE id=1
  </code></pre>
  
  <p>shows <code>field1</code> data truncated to 255 bytes.</p></li>
  <li><p><em>PDO odbc:</em> </p>
  
  <pre><code>$dbh = new PDO ('odbc:DSN=myDSN;UID='.$mssql_login.';PWD='.$mssql_pwd);
  </code></pre>
  
  <p>in which case a result of the same query shows full not truncated data but with question marks instead of Russian symbols. </p></li>
  </ol>
  
  <hr>
  
  <p>Notes:</p>
  
  <ul>
  <li>In the SQL Management Studio data is not truncated and Russian symbols are displayed properly as well.</li>
  <li>We have Windows 2003 Enterprise Edition SP2</li>
  </ul>
  
  <p>So what should we choose as a connection method and how to fix corresponding issues?</p>