WordPress.org

Ready to get started?Download WordPress

Forums

Misfeature/bug in rss feeds (6 posts)

  1. Anonymous
    Unregistered
    Posted 9 years ago #

    When I tried validating the feeds (RSS 0.92 and 2.0) at http://feedvalidator.org/check?url=http://nyfiken.org/wp-rss2.php it complained about char-set, saying that the server states US-ASCII and document states UTF-8, the latter being true.
    Validator's help sent me to http://www.w3.org/International/O-HTTP-charset and a quick solution.
    On line 9/10 in wp-rss.php and wp-rss2.php I changed
    header('Content-type: text/xml', true);
    to
    header('Content-type: text/xml; charset=' . $charset, true);
    and now the feeds validate. Maybe this simple solution can be incorporated in the code?

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Or
    Character encoding
    Add "AddDefaultCharset utf-8" to your .htaccess

  3. jadler
    Member
    Posted 9 years ago #

    Yes, that is also a possibility, if everything else is utf-8 on the site. But my solution makes it fail safe, I think. I'll stick to it anyway. :-)

  4. The only reason that error comes up (the error is not critical, the feed is still valid, and your feed can be read by all post-year-2000 RSS readers) is because one(or more) of your entries is(are) encoded in US-ASCII. The issue will resolve itself as soon as the offending post(s) is(are) no longer on the RSS feed.

  5. jadler
    Member
    Posted 9 years ago #

    I think Podz and W3 are right, actually. The server defaults to US-ASCII and will send a header saying the feed is in US-ASCII unless PHP or .htaccess says utf-8. I have not looked through all the WP code, but I do not think it has to do with any posts being in other encoding. My WP installation has been running on utf-8 from day 1 and there should be no posts in other encodings.

  6. Well, I'm just saying so because it has happened on all of my blogs at least once.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.