Quantcast
Channel: SimplePie RSS Parser - Encoding and Weird Characters even on UTF-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Vicky for SimplePie RSS Parser - Encoding and Weird Characters even on UTF-8

$
0
0

I don't know if you've managed to fix this, but thought I'd share my solution with anyone else who is looking. I had the same problem - the characters were being 'corrupted' in the feed. My code initially (with the problem) was:

<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/inc/simplepie.inc'; $feed = new SimplePie('http://domain.wordpress.com/feed/');?>

Seeing the post above, I tried adding the following header and it worked!

<?php header('Content-type:text/html; charset=utf-8');include_once $_SERVER['DOCUMENT_ROOT'] . '/inc/simplepie.inc'; $feed = new SimplePie('http://domain.wordpress.com/feed/');?>

I hope this helps someone else experiencing the same problems.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>