Re: XML Filters for illegal characters

From: Date: Thu, 06 Jan 2005 18:13:07 +0000
Subject: Re: XML Filters for illegal characters
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-205758@lists.php.net to get a copy of this message
Jones, Douglas 1 wrote: > I'm wondering if anyone knows of a filter that can take data to be wrapped > in XML tags and filter this data encoding any illegal XML characters or, > if they cannot be encoded, remove them. The problem I have is a database > that contains text that must be wrapped in XML. Some of this text has > illegal characters in it (probably copied from MS Word). Some of the > characters that keep popping up are not very frequently used, so I'm > hoping whatever filters get suggested, they can simply strip out these > characters if they cannot encode them. In the user-contributed section of the PHP manual, under htmlentities, I think, there is a nice chunk of code that tells you how to replace all those stupid non-ASCII Microsuck Word characters with the HTML equivalent that will be closest to what it was in Word. Very very nice. It might not be in htmlentities, though -- You'll have to dig around for it... If I could just remember which project I pasted that into, I'd just post it again :-) -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#205758) next »