I have a problem with an rss feed.
When i do <title>This is a title </title>
The title appears nicely in the feed
But when i ddo $title = "this is a tilte";
<title><![CDATA['$title']]></title>
The title doesn't appear at all.
It still doesn't work. I generate my rss feed dynamicly and it looks like this:
$item_template="
<item>
<title>[[title]]</title>
<link>[[link]]</link>
<description><![CDATA[[[description]]]]></description>
<pubDate>[[date]]</pubDate>
</item>
";
and in a loop:
$s.=str_replace(
array("[[title]]","[[link]]","[[description]]","[[date]]"),
array(htmlentities($row["title"]),$url,$description,$date),
$item_template);
The problem is specifically when the title has a euro sign. Then it shows up in my rss validator like:
Â\x80
More detailed information:
Ok I have been struggeling with this for the last few days and I can't find a solution. So I will start a bounty. Here is more information:
- The information that goes in the feed is stored in a latin 1 database (which i administer)
- The problem appears when there is a euro sign in the database. No matter wether its like € or
€
- The euro sign sometimes appears like weird charachters or like Â\x80
- I try to solve the problem on the feed side not on the reader side.
- The complete code can be found over here: codedump
- Next: sometimes when the euro sign cannot be parsed the item (either the title or description) is shown empty. So if you look in the source when showing the feed in an browser you'll find
<title></title>
If there is more information needed please ask.