Dear All,
I'm trying to set up an XML feed form our news articles. My XML is validating.
The issue is some of the articles have a weird encoding.
It seems to be single quotes. For example:
the world<92>s largest live event producer
Notice the <92>.
I already have this to clean vars but its not doing the trick:
// clean bad chars for valid XML
//$patterns[0] = '/=/';
$patterns[1] = '/</';
$patterns[2] = '/>/';
$patterns[3] = '/\'/';
$patterns[4] = '/\"/';
$patterns[5] = '/&/';
//$replacements[0] = '/&eq/';
$replacements[1] = '/</';
$replacements[2] = '/>/';
$replacements[3] = '/'/';
$replacements[4] = '/"/';
$replacements[5] = '/&/';
// chars to replace
$badwordchars=array(
"\xe2\x80\x98", // left single quote
"\xe2\x80\x99", // right single quote
"\xe2\x80\x9c", // left double quote
"\xe2\x80\x9d", // right double quote
"\xe2\x80\x94", // em dash
"\xe2\x80\xa6" // elipses
);
$fixedwordchars=array(
"‘",
"’",
'“',
'”',
'—',
'…'
);
An thoughts would be very helpful.
Thank You,
--
Paul Nowosielski
Webmaster
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php