Subject: | XML::RSS Wrong encoding for utf-8 text with accents |
Date: | Wed, 20 Dec 2006 11:39:25 +0100 |
To: | bug-XML-RSS [...] rt.cpan.org |
From: | franck perrot <franck.perrot [...] epfl.ch> |
Hello,
I use:
- Linux Red hat AS 4 2.6.9-42.0.3.ELsmp #1 SMP Mon Sep 25 17:28:02 EDT
2006 i686 i686 i386 GNU/Linux
- XML::RSS 1.22
- Perl v5.8.5 built for i386-linux-thread-multi
Problem: if I use XML::RSS with utf-8 text (with accents), then the
resulting RSS file is not encoded correctly.
(The same program work perfectly with XML::RSS 1.10.)
For example:
...
$rss = new XML::RSS::Podcast (
version => '2.0',
encoding => 'UTF-8',
);
$rss->channel(
description => "dernières entrées de la videothéque", <-- UTF-8
...
);
give a RSS file with: "dernières entrées de la
videothéque"
Displayed by a web browser and by itunes:
dernières entrées de la videothéque
I tried the "workaround" (??):
http://rt.cpan.org/Public/Bug/Display.html?id=12376
$description = "dernières entrées de la videothéque"; <-- UTF-8
$description =~ s/\&/\&\#038\;/g;
$rss->channel(
description => $description,
...
);
but this did'nt work at all :(
So, I think that since you use HTML::Entities the result for utf-8 with
accent is wrong.
Thanks for any help about this problem. I use XML:RSS since a while but
when I did an upgrade I got this wrong behavior.
Kind regards,
franck Perrot