Forum Moderators: coopster

Message Too Old, No Replies

Problem with special characters after parsing xml

can't seem to get some characters to show properly

         

proper_bo

3:11 pm on Jan 5, 2006 (gmt 0)

10+ Year Member



I am taking an xml document and turning it into html on a webpage.
In the xml document (which is not created by me) there are special characters including (but not limited to) left and right single quotes.

When I echo the php I then get:
‘Lottery win has changed my life’

is there a function or method I can use to decode/change these characters to show up correctly?

Thank you

proper_bo

3:35 pm on Jan 5, 2006 (gmt 0)

10+ Year Member



htmlentities did not work as the characters seem to have been converted before that is possible so I have fixed it using str_replace and the following:

– to -
’ and ‘ to '

mhhfive

7:40 am on Jan 6, 2006 (gmt 0)

10+ Year Member



yeap, I'm having issues with a similar problem. Anyone else have a solution for all the problematic characters, smart quotes, foreign currency symbols, em-dashes, etc etc? I saw Google is having problems, too -- search for "XML Errors in Feeds"...

proper_bo

8:52 am on Jan 6, 2006 (gmt 0)

10+ Year Member



Hi mhhfive,

I'm glad it's not just me then.

So is this a problem with the feed? The creator of the feed should not be using special characters like left and right single quotes?

If so I can get in touch with the creator if there is some kind of standards page that quotes about this problem?

Thanks.