title: Need php to encode special characters but not html tags, for inclusion in a wordpress extended rss file
body: <p>I've written a script that will export all the users, blogs and replies from an existing (non-wordpress) site to a wordpress extended rss file for ease of importing into a new wordpress installation, as part of a migration.  This works well until it comes to a particular blog post with a special punctuation mark in a French or French Canadian phrase.</p>
  
  <pre><code>XML Parsing Error: not well-formed
  Location: http://example.com/wordpress_xml/export-to-wp.php
  Line Number 2000, Column 270:* ... &lt;i&gt;l'art du d\uffffplacement&lt;/i&gt; ... 
  </code></pre>
  
  <p>I've cropped the full error above.  Instead of \uffff a character similar to a comma is shown.  In the php code I have the html of the blog in a string.  I need to encode this type of character without encoding any of the html tags, and after a lot of searching I so far drawn a blank.  Anyone already done something like this?</p>