title: PHP PDO : Charset=UTF8 : An invalid keyword charset was specified in the dsn string
body: <p>I am connecting to an MS SQL server with PDO using the sqlsrv driver.</p>
  
  <p>PHP version is 5.3.24.
  The working connection looks like this:</p>
  
  <pre><code>$dsny = "sqlsrv:Server=xx1;Database=xx2";
  $usery = 'xx3';
  $passwordy = 'xx4';
  $dbhy = new PDO($dsny, $usery, $passwordy);
  </code></pre>
  
  <p>**</p>
  
  <p>But i need to set characters, and then i try this:</p>
  
  <pre><code>$dsny = "sqlsrv:Server=xx1;Database=xx2;charset=utf8";
  $usery = 'xx3';
  $passwordy = 'xx4';
  $dbhy = new PDO($dsny, $usery, $passwordy);
  </code></pre>
  
  <p>When i add the charset i get this error:
  "Fatal error: Uncaught exception 'PDFException' with message 'SQLSTATE[IMSSP]: An invalid keyword 'charset' was specified in the dsn string'"</p>
  
  <p>So what could be causing this fault ?</p>
  
  <p>From what i read i need to do like this since i am running a new PHP version. </p>