Encoding on the site

In general? Changed the encoding on the site (they advised that it was for the better) on UTF-8, made the following.

.htacces file:

AddDefaultCharset UTF-8
charsetdisable on

File index.php:

<?php header('Content-type: text/html; charset=utf-8'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Code itself

    $result = mysql_query("SELECT * FROM cat ");
    }while ($myrow=mysql_fetch_array($result));     

In MySQL database, UTF8 General Ci encoding (in the fields, in the database itself, in the data, in general, everywhere)
CAT table in MySQL: everything is written in Russian in lines!

And so? What happened


Everything displays well, except for the menu, I suffer and there is no result. Tell me how to make the menu earn? Thanks in advance!

Answer 1, Authority 100%

After connecting to the database, do:

mysql_query("SET NAMES utf8");

Do you have a coding in the UTF-8 database but the data is written there in Windows-1251

And even better to record immediately in UTF in the table.

Answer 2

Locate the file from the menu and try to change the encoding on UTF-8. I advise via NotePad ++. Perhaps this is the problem.


And if so try mysql_query("SET NAMES utf8");(when connected to the database).

Answer 3

Do you own a menu template is saved in windows-1251. Open it and save in utf-8.