Skip Menu |

This queue is for tickets about the XML-RSS CPAN distribution.

Report information
The Basics
Id: 12350
Status: resolved
Priority: 0/
Queue: XML-RSS

People
Owner: Nobody in particular
Requestors: mmu+cpan [...] oce.nl
prokurator
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.05
Fixed in: (no value)



Subject: Better xml escaping
I changed the encode_text sub so that it works more reliable, I also added more known html entities to the list.

Message body is not shown because it is too large.

Subject: encoding special characters
1.Distribution: XML-RSS-1.05.tar.gz 2.Perl: v5.6.1 3.Operating systems: Linux RedHat 7.3, 9.0 4.Error description: A lot of our editors use web based application to create new articles and store them into database. They usually use cut and paste techology, which means that they pick up all special characters as they are, literaly. There are no complains from database side when those data is inserted such one can find in the description of the article following text 'The company said its net profit was $1.21bn (£630m), on sales of $45.1bn.' In this text one can clearly see English pound as a special character pasted literaly and it will be accepted by MySQL query. On the other hand, when preparing RSS file using XML::RSS package RSS.pm will not parse it correctly since there is only one hash representing special characters in different way, such as for English pound '£'. This means that rss file will not be displayed correctly on browser (I tested it on IE and on Mozilla). 5.Patch: In order to fix this I added into subfunction encode_text() from package RSS.pm following code: my @text_char = unpack("C*", "$text"); my $text_tmp = ''; foreach my $i (@text_char) { if ($i > 127) { $i = '&#' . $i . ';'; $text_tmp .= $i; } else { $text_tmp .= pack("C*","$i"); } $text = $text_tmp; } Thanks. Lev Radin, prokurator at gmail dot com
Fixed in 1.12.