Probs with character encodings when creating XML feed
Posted: Mon Sep 13, 2004 12:53 pm
Hi,
I've been struggling to find an answer to my problem, I've tried scouring both the official PHP site and other sites for answers to it. I have created an RSS/XML feed for a client's web site which is automatically generated from the news in a Mysql database each time a new article is added. The problem is that the feed keeps on invalidating with dodgy characters such as (for example) é, ®, ò etc. The only way I've managed to stop this from happening all the time is by doing an str_replace for those characters that come up often with an encoded equivelent è, ® etc. But that only stops it from invalidating for so long before another one is entered that I haven't yet listed.
So my question is, is there a PHP function or a PHP script somewhere that will change these characters into ones that will work with XML? Or am I doing something wrong within the RSS/XML setup itself?
The address of the feed in question is
http://www.medicalnewstoday.com/medicalnews.xml
Thanks in advance for your help
A frustrated Alastair
I've been struggling to find an answer to my problem, I've tried scouring both the official PHP site and other sites for answers to it. I have created an RSS/XML feed for a client's web site which is automatically generated from the news in a Mysql database each time a new article is added. The problem is that the feed keeps on invalidating with dodgy characters such as (for example) é, ®, ò etc. The only way I've managed to stop this from happening all the time is by doing an str_replace for those characters that come up often with an encoded equivelent è, ® etc. But that only stops it from invalidating for so long before another one is entered that I haven't yet listed.
So my question is, is there a PHP function or a PHP script somewhere that will change these characters into ones that will work with XML? Or am I doing something wrong within the RSS/XML setup itself?
The address of the feed in question is
http://www.medicalnewstoday.com/medicalnews.xml
Thanks in advance for your help
A frustrated Alastair