Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

superbovine

macrumors 68030
Original poster
I writing an ATOM xml parser particular for blogger.com blogs in php. The blogger client seems to picky about the character->'

It seems to hit or miss. sometimes it is correct when i use curl to bring it in, but it doesn't also translate to HTML. however, it does work most of the time. it always looks correct in terminal, but sometimes has a white space then then character->'

perhaps it has to do with which browser, I entered the blog in using blogger utility?

The error isn't consistant, and idea how could i catch this?
 
Your question is too vague. What are you trying to accomplish and which character exactly? Is it the apostrophe or right-angle bracket character?

In PHP there's the addslashes() function to escape characters like quotes and apostrpohes with \" or \'. Or, maybe you need the htmlentities() function? Hard to know until you give a little more concise detail.
 
Are you trying to display the single quote as it is on the html page? Perhaps you can try using htmlspecialchars or htmlentities in php to convert all the characters to html entities. I am thinking this is not your question.

EDIT:
actually, does the source code of the HTML output gives you inconsistent result as well?
 
the character in question is 0x27 or apostrophy.

My question is blogger.com produces atom.xml files that i am paring with php. after i parse the atom.xml file with php, sometimes the 0x27 character is displayed correctly in a html, but sometimes it isn't. i would just like ideas on how to tackle this. the problem is the problem is the character that get displayed instead of 0x27 is different a lot of the times.

the slash and htmlentities,htmlspecialcharacters etc didn't work.

to answer angelos question: yes html is inconsistant results, however they consistant to the fact that it will be the same character there ever single time. i'll at the raw file i am inputing in a hex editor later. perhaps it will shed some light.

edit: I just looked at the atom.xml source file. 0x27 is getting produced wrong by blogger. Its puts 0xe2 0x80 0x99 instead of 0x27. /shrug however it is consistant my guess is it putting another that is an apostrophe from a different larger character set than ascii because safari rss handles it just fine. Anyway, i was wrong. I'll just use strtr.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.