Character Issues with the Magpie RSS Parser

A client asked for me to put together a page on his website that would collect info off of his RSS feed and populate a page that could be viewable by a handheld device. I decided to use a great tool called Magpie RSS to do the job but I encountered an issue with it not displaying certain characters properly.

When I first used Magpie RSS to parse the feed, some code came back displaying like this:
first
Instead of like this:
second
The solution was simple. Before you first call the Magpie RSS parser with PHP using the following code:

require_once 'rss_fetch.inc';

you need to add:

define('MAGPIE_INPUT_ENCODING', 'UTF-8');
define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');

That will display every foreign character the way it should be displayed.

Share this:

Email
Facebook
Twitter
Pinterest
Pocket

Premium Themes for WordPress

Looking for an easy-to-use Premium Theme for WordPress? Check out Themes by bavotasan.com and have your site up and running in no time.

Use this WordPress website builder to build powerful websites in no time for your or your clients.

WordPress Hosting

WP Engine – designed from the ground-up to support and enhance the workflow of web designers.

Bluehost – providing quality web hosting solutions since 1996.

About the author

Picture of Luke Perrie

Luke Perrie