title: How do I convert Word smart quotes and em dashes in a string?
body: <p>I have a form with a textarea. Users enter a block of text which is stored in a database.</p>
  
  <p>Occasionally a user will paste text from Word containing smart quotes or emdashes. Those characters appear in the database as: â€“, â€™, â€œ ,â€</p>
  
  <p>What function should I call on the input string to <em>convert smart quotes to regular quotes and emdashes to regular dashes</em>? </p>
  
  <p>I am working in PHP.</p>
  
  <p>Update: Thanks for all of the great responses so far. The page on Joel's site about encodings is very informative: <a href="http://www.joelonsoftware.com/articles/Unicode.html" rel="nofollow noreferrer">http://www.joelonsoftware.com/articles/Unicode.html</a></p>
  
  <p>Some notes on my environment:</p>
  
  <p>The MySQL database is using UTF-8 encoding. Likewise, the HTML pages that display the content are using UTF-8 (Update:) by explicitly setting the meta content-type.</p>
  
  <p>On those pages the smart quotes and emdashes appear as a diamond with question mark.</p>
  
  <p>Solution:</p>
  
  <p>Thanks again for the responses. The solution was twofold:</p>
  
  <ol>
  <li>Make sure the database and HTML
  files were explicitly set to use
  UTF-8 encoding.</li>
  <li>Use <code>htmlspecialchars()</code> instead of
  <code>htmlentities()</code>.</li>
  </ol>