Feed Content API and encoding="iso-8859-1" - Mozilla

This is a discussion on Feed Content API and encoding="iso-8859-1" - Mozilla ; Ciao all, I'm using the Feed Content API as documented here: http://developer.mozilla.org/en/NsIFeedTextConstruct it works perfectly when the feed in UTF-8 encoded, but when it is encoded with iso-8859-1, the weird non-ascii characters are not decoded. I'm using parser.parseFromString(data, uri), and ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Feed Content API and encoding="iso-8859-1"

  1. Feed Content API and encoding="iso-8859-1"

    Ciao all,
    I'm using the Feed Content API as documented here:

    http://developer.mozilla.org/en/NsIFeedTextConstruct

    it works perfectly when the feed in UTF-8 encoded,
    but when it is encoded with iso-8859-1, the weird non-ascii
    characters are not decoded.

    I'm using parser.parseFromString(data, uri), and
    plainText() method to get the data of the title
    and the summary.

    Needless to say: what did I miss?

    thanks

    m


  2. Re: Feed Content API and encoding="iso-8859-1"

    On Oct 1, 3:51*pm, marco wrote:
    > Ciao all,
    > I'm using the Feed Content API as documented here:
    >
    > http://developer.mozilla.org/en/NsIFeedTextConstruct
    >
    > it works perfectly when the feed in UTF-8 encoded,
    > but when it is encoded with iso-8859-1, the weird non-ascii
    > characters are not decoded.
    >
    > I'm using parser.parseFromString(data, uri), and
    > plainText() method to get the data of the title
    > and the summary.
    >
    > Needless to say: what did I miss?
    >
    > thanks
    >
    > m


    More on the subject:

    one way I can make it work is to ask the XMLHttpRequest
    to send back XML using:

    xhr_req.overrideMimeType('text/xml');

    and then serialize the feed XML to string with:

    var serializer = new XMLSerializer();
    var feed_text = serializer.serializeToString(xhr_req.responseXML);

    before passing it to:

    nsIFeedProcessor.parseFromString(text, uri);

    The above is of course the above no good at all, since I do twice
    the same parsing job, but it seems to reveal that there is some
    encoding-based issues within the XML parser behind nsIFeedProcessor.

    Any hint anybody?

    thanks

    m

+ Reply to Thread