I had a similar problem recently, but was not able to work with it in PHP tho. The array for that mapped characters to their entity turned out to be HUGE and it took forever to evaluate long XML files.
I ended up killing several birds with one stone by wrapping the html-tidy utility (tidy.sourceforge.net) in php. It validates xml, converts all characters >127 into their respective entity, pretties up the XML output, cleans up Word 2000 specific content and deals with a variety of input/output encodings. It did all these a lot faster that any of the scripts I had written and saved me from writing others. -----Original Message----- From: Russell P Jones [mailto:[EMAIL PROTECTED] Sent: Sunday, August 03, 2003 6:52 PM To: [EMAIL PROTECTED] Subject: [PHP] Invalid Characters, XML... Im using PHP to write to XML files, but I am having some problems. A lot of users are cutting and pasting content from text editors like word, which uses odd quotation marks, dashes, etc. which PHP writes to the XML file, and then the XML parser does not under stand. Is there a stripslashes() or htmlspecialchars() equivalent that will convert this kind of stuff to the correct ascii text? Russ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php