Question

I am having a problem with our RSS feed displaying correctly in Safari but not in Firefox. A sample is shown below. The issue is in the <title> tag under <pubdate>. The ó shows correctly in Safari but is spelled out in Firefox. Has anyone encountered this problem?

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/rss/styles/shared_xsl_stylesheet_v2.xml"?>
<rss version="2.0">
   <channel>
   <title>Updates: What's New on The Website</title>
   <link>http://www.site.com/news/whatsnew/wn-today.shtml</link>
   <description>The latest events, developments, and updates to the website</description>
   <language>en-us</language>

   <pubDate>Thu, 10 Sep 2009 11:58:18 EDT</pubDate>
   <lastBuildDate>Wed, 09 Sep 2009 16:41:00 EDT</lastBuildDate>
   <item>
     <title>Pronunciamiento de la Presidenta de la Comisi&oacute;n de Valores y Bolsa</title>
     <link>http://www.site.com/divisions/corpfin/cfnew/cfnew0909.shtml</link>
     <description>Pronouncements</description>

     <guid isPermaLink="false">2009-09-09-000115</guid>
     <pubDate>Wed, 09 Sep 2009 16:41:00 EDT</pubDate>
  </item>
</channel>

Edited to show the above as code. :-)

Was it helpful?

Solution

ó is valid in UTF-8 encoded documents. The problem is that you reference &oacute; but the entity needs to be defined in a DTD somewhere because the default DTD doesn't define it because ó is valid in UTF-8 encoded XML.

Check out the W3C's Validator.

OTHER TIPS

This example worked like a champ! (I couldn't have been on the right path without getting started by some of the great answers here. Thanks Mike Buckbee and CptSkippy)

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE channel [ 
<!ENTITY oacute "&#211;">
<!ENTITY nbsp "&#160;">
]>
<rss version="2.0">
<channel>
<title>RSS Example</title>
<description>This is an &oacute; example &nbsp; of an RSS feed</description>
<link>http://www.domain.com/link.htm</link>
<lastBuildDate>Mon, 28 Aug 2006 11:12:55 -0400 </lastBuildDate>
<pubDate>Tue, 29 Aug 2006 09:00:00 -0400</pubDate>

<item>
<title>Item Example</title>
<description>This is an example of an Item</description>
<link>http://www.domain.com/link.htm</link>
<guid isPermaLink="false"> 1102345</guid>
<pubDate>Tue, 29 Aug 2006 09:00:00 -0400</pubDate>
</item>

</channel>
</rss>

I believe in either case it is actually encoded, but the Safari view is more sophisticated (may not be a good thing).

If you want to really "see" what is happening with the HTML, your best bet is to use curl or wget to directly download the RSS feed and then view the file in a text editor.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top