views:

17

answers:

2

I am working on a wordpress project. The my database is in utf general. It seems everything is fine in database side, the rest of the website is working wel except the comments. When i display comments wordpress just display symbols rather than words can anyone help me?

+1  A: 

First off, check that these symbols aren't actually in the database - this usually happens during an import/export between databases.

If everything is fine, check that a Content-Type header is being sent like so (I use HttpFox);

Content-Type: text/html; charset=UTF-8

Also, but don't hold me to it, I have read some (older) browsers still need a Http-Equiv tag in the HTML <head />;

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

And make sure your database connection is also UTF-8 - with MySQL, use SET NAMES.

WordPress should already be doing most of this, but no harm in checking.

TheDeadMedic
i've check the database, comments are in correct form there.the rest of the website is working fine, post and pages are also in urdu and there is no issue with them. it clears that there is no problem with html character set and my sql connection...kindly visit: http://eeqaz.orgi've uploaded the website there...
TechMulla
"it clears that there is no problem with html character set and my sql connection" - do you mean you have made the checks I suggested in my answer, or that you assume everything should be fine because the database is OK?
TheDeadMedic
A: 

In addition to all that TheDeadMedic has said, make sure that:

  • In your wp-config.php, you set define(‘DB_CHARSET’, ‘utf8′);
  • The SQL connection has SET NAMES UTF8

I've had a case where the second could not be done, and ultimate character sets returned to normal by me taking out define(‘DB_CHARSET’, ‘utf8′);, however.

chryss