Jump to content

Archived

This topic is now archived and is closed to further replies.

elg2001

PHP, XML, UTF-8, and XHTML validation

Recommended Posts

Hi,
I'm having some trouble with the backend of my website. It's blog software that takes the input from a text field (title) and textarea (body contents) and stores it into an XML node in UTF-8. However, occasionally I'll get a validator.w3.org validation error on my website saying the following:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Error Line 14 column 167: non SGML character number 156[/quote]

for example. I believe it's a unicode character, but i'm not sure. Basically, are there any built-in functions that will translate any input text to a valid UTF-8 character? If there is not an acceptable replacement, then use a particular character to replace unrecognizable characters. For instance, a double width dash shows up as invalid on my site, so replace that character with a question mark.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.