View Full Version : Problem in validating page with unicode text

May 24th, 2007, 10:08 AM
Hi friends,

I've been building a site in php+mysql as backend and most of the contents in the site are in local language(malayalam), so I opted unicode to store and display them.

My dream is to display a 'w3c valid' symbol and i'm struggling on it.

Now,my problem is some of my unicode text shows an error on validation (these texts are stored in database as unicode)

For a demo of my problem I've uploaded one of my page with only one such content shown (commenting php loop)

please have a look at it, all the links are not working as its only a demo.


This particular item shows 2 errors and if i remove the php-comment, there are 20 items and which results around 27 errors, all are due to this unicode.

These items are compiled by a rich text editor provided in the html form.

Can I make my dream true? or can i place a 'w3 icon' even if there are errors like this?

thanks n regards,

Bill Posters
May 24th, 2007, 10:29 AM
Two PHP functions you should look into are htmlspecialchars() (http://uk3.php.net/htmlspecialchars) and htmlentities (http://uk3.php.net/htmlentities).

I personally wouldn't put up a W3C validity badge unless I was certain that the page was, and would stay, valid. I personally wouldn't put up a badge either way (although a I value code validity highly), but I appreciate that there are some fair reasons to promote the fact that a site is standards compliant on-page.

May 24th, 2007, 01:48 PM
Thanks Bill,

I tried the two functions

and then i tried
utf8_decode() also, but no progress yet.

I've some other pages with more content , and amazingly they validates successfully.

One example is http://trials.casemumbai.com/trials/About.htm

The only difference is this content was placed statically in the document.

but i don't think it's due to this since I've other pages which takes content from database and validate correctly.

any other clues?