title: PHP saving string with accents
body: <p>I'm having an issue when trying to save strings with accents.</p>
  
  <p>Our online system is used by clients from different countries, so some of our clients use accents.</p>
  
  <p>When doing a request to get the value to save like this</p>
  
  <pre><code>$value = trim(strip_tags(htmlspecialchars($_REQUEST['value'], ENT_QUOTES, 'UTF-8')));
  </code></pre>
  
  <p>It saves the value in this way</p>
  
  <pre><code>GÃ©
  </code></pre>
  
  <p>If instead of htmlspecialchars I use htmlentities it saves like this</p>
  
  <pre><code>g&amp;eacute;&amp;icirc;
  </code></pre>
  
  <p>The correct string I'm trying to save is</p>
  
  <pre><code>Gé
  </code></pre>
  
  <p>I need this to be saved correctly so it can be displayed correctly on screens and reports.</p>
  
  <p>Our db uses UTF-16 (MS SQL Server), and I'm declaring the meta tags to use UTF-8 on the page like this</p>
  
  <pre><code>&lt;meta charset='utf-8'&gt;
  &lt;meta http-equiv='Content-Type' content='text/html; charset=utf-8'&gt;
  </code></pre>
  
  <p>This is how the connection looks:</p>
  
  <pre><code>$link = sqlsrv_connect($dbserver, array(
      'Database'=&gt;$database,
      'UID' =&gt; $uid,
      'PWD' =&gt; $pwd,
      'CharacterSet' =&gt; 'UTF-8'
  ));
  </code></pre>