Correctly escape special characters in RSS feed URLs #490

wants to merge 1 commit into


None yet

3 participants


As discussed on IRC. Some RSS clients (e.g. NetNewsWire) choke on special characters in URLs.

The problem I'm fixing can be demonstrated by running ` curl | grep -o -E http://.+?müllers '. The URLs should contain m%C3%BCllers instead of müllers.

This patch tells quote_plus to urlencode the url strings' special characters to their UTF8 code, unless they are the safe characters ':' or '/'.

@grischard grischard Correctly escape special characters in RSS feed URLs, as discussed on…
… IRC. Some RSS clients choke on special characters in URLs.
@spladug spladug commented on the diff Aug 13, 2012
@@ -32,6 +33,7 @@
url = thing.mousedown_url
url = permalink
+ url = quote_plus(url.encode('utf8'), '/:')
spladug Aug 13, 2012 reddit member

I think this would incorrectly urlencode the domain component of a URL with internationalized domain name, wouldn't it?

spladug commented Aug 13, 2012

Side note: we generally try to stick to the convention on how git commit messages should look. Would you mind fixing up your commit message, please?


Indeed, I hadn't thought of IDNs at all, so I'll test that, and come back with a properly formatted git commit message. Thank you.

Deimos commented Jun 12, 2013

There haven't been any updates to this pull in a very long time, so I'm going to close it. Please submit a new pull request if you want to reopen it.

@Deimos Deimos closed this Jun 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment