In addition, in the HTML inside, inside we have to write:
<meta charset="utf-8">
When we create the MySQL database, we should use something like this:
CREATE DATABASE `base` DEFAULT CHARACTER SET=utf8;
When we create tables, use:
CREATE TABLE `base`.`table` (
`key` int(5) unsigned NOT NULL,
`name` varchar(100),
...
PRIMARY KEY (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
In the PHP code, after mysql_connect () and mysql_select_db (), use:
mysql_query('SET NAMES UTF8');
source
share