phpMyAdmin insists on forcing my utf-8 characters into latin1.
Server Info:
Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.0.27 - Source distribution
Protocol version: 10
Server charset: UTF-8 Unicode (utf8)
phpMyAdmin Version information: 4.0.10 PHP Version 5.2.11
The server version and PHP version is not under my control, and phpMyAdmin is the latest version that will run under PHP 5.2
Neither Import or straight SQL will work. My own internal PHP tools handle utf8 just fine, and update the database correctly.
DROP TABLE IF EXISTS `tempchar`;
SET character_set_client = utf8;
CREATE TABLE `tempchar` (
`id` int(11) NOT NULL DEFAULT '0',
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`active` int(1) NOT NULL DEFAULT '0',
`type` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `tempchar` VALUES (382,'Vicenté Marcos de Cervantés',2,0);
The end result (viewed as utf8) is:
382 : Vicent� Marcos de Cervant�s
Same result when switched to 'Western' (latin1 etc)
382 : Vicenté Marcos de Cervantés
Code that produces the above output:
$result=mysql_query("select * from tempchar where active=2 order by name");
while($row=mysql_fetch_array($result)) {
echo "$row[id] : $row[name]<br>\n";
}
It is clearly phpMyAdmin stepping in and doing something unnecessary. Has anyone got any clues as to how to get it to behave?