camelreader has asked for the wisdom of the Perl Monks concerning the following question:
I've recently been moved to a new hosting environment I don't have much control of. Previously I had an rss feed generated by XML::RSS 1.05 my new environment has XML::RSS 1.48 which has resulted in problems with my rss feed.
A minimal test case follows:
1.05 results as desireduse XML::RSS; my $rss = new XML::RSS (version => '1.0', encoding => "UTF-8"); $rss->channel(title => "Test", link => "http://example.com", description => "Test script", ); $rss->add_item(title => "Test", link => "http://example.com/2", description => "<i>Some HTML</i> Some text", ); $rss->{output} = '1.0'; print $rss->as_string;
1.48 results with undesired encoding<?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" > <channel rdf:about="http://example.com"> <title>Test</title> <link>http://example.com</link> <description>Test script</description> <items> <rdf:Seq> <rdf:li rdf:resource="http://example.com/2" /> </rdf:Seq> </items> </channel> <item rdf:about="http://example.com/2"> <title>Test</title> <link>http://example.com/2</link> <description><i>Some HTML</i> Some text</description> </item> </rdf:RDF>
<code> <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" > <channel rdf:about="http://example.com"> <title>Test</title> <link>http://example.com</link> <description>Test script</description> <items> <rdf:Seq> <rdf:li rdf:resource="http://example.com/2" /> </rdf:Seq> </items> </channel> <item rdf:about="http://example.com/2"> <title>Test</title> <link>http://example.com/2</link> <description><i>Some HTML</i> Some text</descripti +on> </item> </rdf:RDF>
The key difference in the feed is the HTML portion:
Any help getting the 1.48 version to work as intended would be much appreciated, I'm having a difficult time figuring out what option I may need to switch to get it to output as intended.<description><i>Some HTML</i> Some text</description> vs <description><i>Some HTML</i> Some text</descripti +on>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problems with HTML Encoding in RSS after moving to XML::RSS 1.48
by ikegami (Patriarch) on Oct 22, 2010 at 18:11 UTC | |
by camelreader (Initiate) on Oct 22, 2010 at 18:41 UTC | |
by ikegami (Patriarch) on Oct 22, 2010 at 18:52 UTC | |
by Corion (Patriarch) on Oct 22, 2010 at 19:06 UTC | |
by ikegami (Patriarch) on Oct 22, 2010 at 22:25 UTC | |
|
Re: Problems with HTML Encoding in RSS after moving to XML::RSS 1.48
by kcott (Archbishop) on Oct 22, 2010 at 20:03 UTC | |
by ikegami (Patriarch) on Oct 22, 2010 at 22:33 UTC |