Question: The following Atom feed has invalid characters, and is making my reader app crash because the XML library cannot parse it:

> 
> <https://stackoverflow.com/feeds/tag/windows-8.1%20OR%20windows-store-apps%20OR%20windows-8%20OR%20windows-phone-8%20OR%20windows-runtime>
> 
> 
> 

Feeds change too fast, so by the time you see this report the feed may not be invalid anymore, so I am copying the feed here:

> 
> <https://skydrive.live.com/redir?resid=63207E51377958A9!12583&authkey=!ALmX1rIbGv-bais&ithint=file%2c.xml>
> 
> 
> 

This is not the first time I've seen an invalid feed.

The problem is that there are multiple 0x1E bytes, the first one is in line 121 character 48, or byte 7104.

That is the `<summary>` of this question: 

> 
> [System.InvalidCast exception Windows Runtime](https://stackoverflow.com/questions/21742963/system-invalidcast-exception-windows-runtime)
> 
> 
> 

So any Atom feed containing that question is invalid.

Answer: 
You're right, U+001E is not a [valid character in XML 1.0](//en.wikipedia.org/wiki/Valid_characters_in_XML), which the SO Atom feed claims to be. The same goes for all other [C0 control characters](http://en.wikipedia.org/wiki/C0_and_C1_control_codes) too, except for TAB (U+0009), LF (U+000A) and CR (U+000D).

Those characters *are* valid in XML 1.1, [as long as they're encoded as entity literals](https://stackoverflow.com/questions/1170270/how-do-i-escape-unicode-character-0x1f-in-xml) (e.g. `&#x1E;`). However, given that they have no obvious *use* in an Atom feed, it would probably be better to just filter them out.
The same issue popped again as I reported here:
<https://support.stackenterprise.co/support/tickets/15320>

Consequence was that Thunderbird was unable to load the feed until the invalid characters slid out of the feed.

The error that popped on this feed is now gone, but here is the error reported by the validator from W3C:

> 
> Sorry
> This feed does not validate.
> 
> ```
> line 206, column 1357: XML parsing error: <unknown>:206:1357: reference to invalid character number [help]
> 
>     ... /p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&#xA0;&#x13; &#xA;&lt;/code&gt;&lt;/pr ...
>                                                  ^
> 
> ```
> 
> 

If you [run the W3C validator today](https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fstackoverflow.com%2Ffeeds%2Ftag%3Ftagnames%3Dbash%26sort%3Dnewest), it sill reports an issue with the namespace:

> 
> This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
> 
> ```
> line 2, column 0: Use of unknown namespace: http://purl.org/atompub/rank/1.0 [help]
> 
>     <feed xmlns="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:re="http://purl.org/atompub/rank/1.0">
> 
> ```
> 
>