#32 Bugfix: Incorrect Encoding set by RSS_2_0_Exporter


Bug + required code changes to fix:

Problem Description:
In de.nava.informa.exporters.RSS_2_0_Exporter,
RSS_1_0_Exporter and RSS_0_91_Exporter, there is a
bug whereby the encoding that was set during
construction is not applied to the output, resulting in an
output that is often considered invalid by IE and RSS
readers like RSS Bandit.

In the method
public void write(ChannelIF channel) throws
the code currently reads:
XMLOutputter outputter = new XMLOutputter
but it should actually read:
Format format = Format.getPrettyFormat();
XMLOutputter outputter = new XMLOutputter

This is likely to fix the issue raised in
It's not just Spain that suffers - I found that anything
including a "Ł" also suffered, which therefore includes a
lot of UK newsfeeds.

Note: Ideally, these 3 modules should be opened up a
bit to make the creation of derrived classes easier - at
present, everything is private or one monolithic public
method, which doesn't leave much room for
customisation. In order to create a bugfixed version of
this class, one basically has to take a copy of the code
and create a new class, rather than inheriting from the

I've attached a fixed version of the RSS_2_0_Exporter
class. It should be trivial to do likewise for the 1_0 and
0_91 versions. These changes were made by editing
the source from Informa 0.6.0, in which
RSS_2_0_Exporter.java was version 1.3.


  • Niko Schmuck

    Niko Schmuck - 2005-09-27

    Logged In: YES

    Thanks, Peter, for sending in your patch. I will integrate
    it to be part of the next informa release.

    Greetings, Niko

  • Peter Darton

    Peter Darton - 2005-09-27

    Logged In: YES

    Shortly after posting that bugfix, I found that you'd fixed the
    original bug in the CVS version. However, in the project I'm
    working on at present, I found the current exporter
    functionality a bit limited, so I adapted & refactored the code
    a bit, pulling out code that was common to all three exporters
    into a common abstract base class, and making it easier to
    subclass the whole thing.
    If you're going to do a code change, I'd suggest you take
    my "new improved" version (you'd have to change the
    package names back & remove my CVS headers tho').

    Regards, Peter

  • Peter Darton

    Peter Darton - 2005-09-27

    Refactored code - .zip containing 4 .java files.

  • Niko Schmuck

    Niko Schmuck - 2007-06-27
    • assigned_to: niko_schmuck --> wieben

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks