[thelist] RSS Feed errors - encoding issues

Paul Bennett Paul.Bennett at wcc.govt.nz
Wed Oct 11 16:53:45 CDT 2006


Hi all,

I'm generating an RSS feed based on the last 20 news releases added to the site. It works fine in my feed reader and google reader, but the feed validator and yahoo's beta reader are barfing on some character encoding issues. My charset is iso-8859-1.

I've got some str_replace() script-fu going to replace nasty stuff, as well as using htmlentities() to try and convert all relevant characters to named entities.

I can't seem to catch this character though (he's a slippery devil): ' ' '

I've tried doing this:

str_replace("'", ''', $data); // copy character straight in

And this:

str_replace("&#x0092", ''', $data); // converted hex ref

And this:

str_replace("\x92", ''', $data); // plain hex ref

But he still sneaks through. Any ideas on how I can trap this sucker and convert him correctly?


Paul



More information about the thelist mailing list