Weird and Strange Characters After Parsing RSS Feeds?

I ran into the “weird characters” problem when I used PHP (specifically the SimplePie script) to parse an rss feed and output the results to a page.

These characters can be apostrophes and quotes among others.

If you need to fix the problem, it’s pretty easy to do. Change the charset at the top of your page to match the output of the rss parser results. Or vice versa and it should work. To see more of an explanation and how to do that visit SimplePie’s docs regarding the matter.

In my case, I set the encoding of my results page to UTF-8, (which is what SimplePie uses) and that fixed it. Now the weird characters are gone and I’m left with regular looking apostrophes.

Your email address will not be published. Required fields are marked *

*