0

I have created a custom home.php file inside my template dir of wordpress. It's okay but the encoding is broken and I do not understand how to fix it.

The page is a simply custom .php page. Here you can see: http://tomsblog.it/

More info: - I get the informations from a utf8_general_ci database - The page is encoded with UTF-8 - The php code is a simple mysql_fetch_object

$result = $mysql->query("SELECT * FROM blogs WHERE id = 5");
$article = mysql_fetch_object($result);
echo $article->title;

Thanks

Oscar Fanelli
  • 2,579
  • 1
  • 22
  • 38
  • possible duplicate of [UTF-8 all the way through](http://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – Pekka Dec 11 '13 at 17:41
  • Can you provide more information and show some code? As it stands, this question isn't likely to be useful once the problem is solved. SO's main mission is to be an archive of questions & answers for future generations so the question should describe the problem in full – Pekka Dec 11 '13 at 17:42
  • I have added some informations – Oscar Fanelli Dec 11 '13 at 17:51

1 Answers1

0

can you check the database how the data is storing meaning like it is storing correctly if not you have a problem try to replace the data on a tables here is the link may this help you

UPDATE:

check database character set in wp_config.php file ie. in root folder define('DB_CHARSET', 'utf8');

Ondrej Janacek
  • 11,896
  • 14
  • 52
  • 87
Sumit
  • 648
  • 4
  • 10
  • And is there anything that i can set inside my php code? However if i put this page outside of wordpress, everythings work well, so i thing it's come wordpress config directive. – Oscar Fanelli Dec 11 '13 at 18:39
  • If you want to extend your answer, just update your already provided. Do not create another one, please. – Ondrej Janacek Feb 01 '14 at 14:00