CheckRSS Check a feed

CheckRSS › Blog › Publishing

Common RSS errors: encoding, dates and enclosures, with fixes

The RSS errors that slip past a quick look: wrong encodings and mojibake, illegal characters, bad date formats and broken podcast enclosures, with fixes.

PublishingCheckRSS5 min read

Some feed errors are loud: the XML breaks and no reader shows anything. The ones in this post are quieter. The feed loads, but apostrophes turn into ’, new posts sort below old ones, or a podcast app skips an episode without saying why. They come from three places: character encoding, dates and enclosures.

If the feed does not load at all, start with RSS feed not working?, which covers firewalls, caches and redirects. Everything below assumes the feed loads and the checker is flagging something, or a reader is behaving oddly.

Encoding

Declared UTF-8, written as Windows-1252

The declaration at the top of the file is a promise:

<?xml version="1.0" encoding="UTF-8"?>

The parser believes it. If the bytes that follow were actually written in Windows-1252 (common with older PHP code, databases with a Latin-1 table, or text pasted from Word), every byte above 127 is misread. A curly apostrophe in Windows-1252 is the single byte 0x92, which is not valid UTF-8 on its own. Strict parsers stop with an encoding error; lenient ones replace it with a question mark or a box.

The opposite mistake produces the familiar mojibake. Text that was correctly UTF-8 gets decoded as Windows-1252 somewhere along the way and saved again:

Before: It’s ready
After:  It’s ready

The three UTF-8 bytes of ’ (E2 80 99) were read as three Windows-1252 characters. If you see ’, “ or é in a feed, the text was double-encoded before it reached the feed template. The fix belongs at the source: the database connection charset, the import script, or the CMS setting that converts text. Patching the feed output only hides it.

To see what the bytes really are, download the feed and look:

curl -s https://example.com/feed/ -o feed.xml
file feed.xml
grep -n $'\x92' feed.xml | head

A byte order mark in front

Some editors and frameworks write a UTF-8 byte order mark (EF BB BF) at the start of the file. The XML specification allows it, and many parsers accept it. Some readers and older libraries do not, and treat it as content before the declaration. There is no benefit to keeping it, so remove it from whatever template or file emits the feed.

Escaped twice

When a CMS escapes text and the feed template escapes it again, readers show the entities instead of the characters:

<!-- Before: shows "Fish &amp; Chips" in readers -->
<title>Fish &amp;amp; Chips</title>

<!-- After -->
<title>Fish &amp; Chips</title>

Look for &amp;amp;, &amp;#8217; or &amp;quot; in the raw feed. Find which layer escapes first, and stop the second one.

Control characters

XML 1.0 forbids most control characters, everything below 0x20 except tab, line feed and carriage return. Escaping does not help: &#x0B; is just as illegal as the raw byte. These characters arrive in copy-pasted text, OCR output and data from spreadsheets, and a single one breaks the whole feed. Our directory crawl found 31 feeds with broken XML, and this is one of the usual reasons.

Strip them when the feed is generated. In most languages a regular expression over the character class [\x00-\x08\x0B\x0C\x0E-\x1F] does it.

The CDATA trap

Wrapping HTML in CDATA saves escaping it:

<description><![CDATA[<p>Fish & chips, <em>Fridays</em>.</p>]]></description>

The one sequence a CDATA section cannot contain is its own end marker, ]]>. A code sample in a post that includes ]]> ends the section early and breaks the feed. Split the marker across two sections when you write it out:

<![CDATA[ ... a[b[0]]]]><![CDATA[> ... ]]>

CDATA also does not protect against control characters. They are illegal everywhere in the document.

Dates

RSS wants RFC 822

RSS 2.0 dates follow RFC 822, with a four-digit year:

<pubDate>Sat, 28 Nov 2026 09:30:00 +0000</pubDate>

The common mistakes, all of which we see in real feeds:

Written asProblem
2026-11-28T09:30:00ZISO 8601, which is Atom's format, not RSS
Sat, 28 Nov 2026 09:30:00 CESTNamed zones outside the US ones and GMT/UT are not RFC 822
Sa, 28 Nov 2026 09:30:00 +0100Day and month names must be English
28 November 2026Full month name, no time
Sat, 28 Nov 2026 9:30 +0000Hours and minutes need two digits each; seconds are optional but common

RFC 822 knows UT, GMT and the four US zones (EST, EDT, CST, CDT, MST, MDT, PST, PDT), plus military letters nobody uses. Everything else, including CET, CEST and BST, is invalid. A numeric offset like +0100 always works and is the safest choice.

Localized names are the classic bug on non-English sites: the date is formatted with the server's locale, so a Polish server writes sob, 28 lis 2026. Format feed dates with a fixed English locale, or build them from numbers yourself.

Atom wants RFC 3339

Atom uses RFC 3339 for published and updated:

<updated>2026-11-28T09:30:00+01:00</updated>

The time zone is required. 2026-11-28T09:30:00 without Z or an offset is invalid, and readers guess, often wrong by hours.

Dates in the future

An item dated in the future, typically from a wrong server time zone or a scheduled post that leaked into the feed early, is a problem for readers that sort by date: it stays pinned at the top of the list until the clock catches up. Some readers hide it until that time. If posts appear in readers an hour or two "late" or "early", compare the offset in the feed with the actual time zone of the server.

Enclosures

Enclosures are what make a podcast feed: one enclosure element per item that points to the media file. Three attributes, all required:

<!-- Before -->
<enclosure url="http://cdn.example.com/ep42.mp3" type="audio/mp3" length="0"/>

<!-- After -->
<enclosure url="https://cdn.example.com/ep42.mp3" type="audio/mpeg" length="48213760"/>

length is the file size in bytes, not the duration. Some generators put seconds or zero there. Apps use the size for download progress and storage estimates; a wrong value is rarely fatal, but validators flag it.

type must be a real media type. MP3 is audio/mpeg; audio/mp3 is not registered and some apps reject it. AAC in an MP4 container is audio/x-m4a or audio/mp4, and video is usually video/mp4.

url should be HTTPS. Apple Podcasts and most modern apps expect it, and mixed HTTP media fails in some browsers.

RSS 2.0 allows only one enclosure per item. A second one is ignored by most apps, so if you publish two formats of an episode, publish them as separate items or pick one.

Tracking prefixes are fine. Many podcast analytics services work by redirecting the enclosure URL through their own domain before it reaches the file. Each redirect adds a request, and a chain of three or four can time out in some apps. Keep it to one or two hops, and make sure every hop is HTTPS and returns a 302 or 301 rather than an HTML page.

Among the 125 podcasts in our directory, the most frequent problems were podcast-level tags rather than enclosures (67 shows without itunes:category, 63 without itunes:image). The podcast feed validator checks both, and the podcast feed explainer goes through every tag Apple and Spotify read.

Finding these in your own feed

None of these errors show up when you open the feed in a browser, because browsers are forgiving and do not sort items. Run the address through the checker: it reports encoding failures with the line, lists dates that are not in the right format, flags items with future dates, and checks that every enclosure carries its url, type and length. Fix encoding first, since a single bad byte can hide every other problem behind a parse error. For a step-by-step method that includes the command-line checks, see how to validate an RSS feed.

More from the blog