On 12/08/2003 04:37 PM, Russell P Jones wrote:
Im storing a lot of user-entered data in XML files but i have a problem with folks submitting stuff just by copying and pasting from microsoft word. "Smart Quotes" and other awkward text then gets submitted and ruins the xml, meaning i am searching and replacing item by item to replace stuff.
Does anyone know how I could do this automatically, as in is there anything that will convert a string to UTF-8 automatically
ideally $fixed = convert-to-utf($oldmessedupstring)
any ideas? Will CDATA sections allow non UTF-8 text?
There is the function utf8_encode() but if you want to generate XML, you may also want to try this class that performs whatever conversions you need:
http://www.phpclasses.org/xmlwriter
--
Regards, Manuel Lemos
Free ready to use OOP components written in PHP http://www.phpclasses.org/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php