tags:

views:

76

answers:

1

I'm trying to use an RSS feed from my blog on the news section on another site. Everything seems to be working fine until I use something like an ellipsis on my blog.

The expected output is:

One more time…less fail
Although this is no joking matter…

The actual output is:

One more time?less fail
Although this is no joking matter…

The problem is that ? should be a .... The code I'm using is the same for the first line (the blog title) and the second line (the blog contents) and that code is:

$a = utf8_decode($a);
print($a);

Where $a is the string from the RSS feed.

Can anyone point in the right direction why that code would work correctly for the body (second line) and not for the title (first line)? Or suggest a better way to do this?

Thanks!

Update: If you'd like to check out the RSS feed for yourself in order to provide accurate code, it can be found at: feed://chimaera.fortunestreetglobal.com/wordpress/?feed=rss2

Edit: Just to clarify, I'm really looking for how I should handle the RSS such that no matter what is posted in the blog, it will be displayed correctly on my other site.

+4  A: 

Actually it's not ... but (horizontal ellipsis) encoded as … in the feed. There is no equivalent (single) character in iso-8859-1 and therefore utf8_decode() replaced it by ?.

edit: The content of the description tag is marked as <![CDATA[ ... ]]>. Libxml chose not to resolve the "entity" in

<description><![CDATA[Although this is no joking matter&#8230;

but to return it as-is. So you sent &#8230; to the client/browser and there it was resolved and shown as .

VolkerK
Yes, you're right that it should be a horizontal ellipsis. And your answer makes sense to me, but I guess the deeper question is how should I be handling this so that whatever they post on the blog is displayed correctly on my site?
mrduclaw
It would seem by your answer to imply that if I simply don't do any `utf_decode()` things would work like I want (that is, the browser would be sent `…` and then displayed correctly), but what happens instead is `One more time…less fail`.
mrduclaw
The feed is utf-8 encoded. Why not simply send the html document utf-8 encoded as well?
VolkerK
I love that idea, I'm terribly new to everything like this. How can I do that? :D
mrduclaw
Lol i think i got. You sir, are a genius. Thanks so much!
mrduclaw