MySQL not handling UTF-8 encoding correctly?
Posted: Thu May 01, 2008 12:42 pm
In my common.php file - used in all pages - I've defined the following;
This is what I've inserted into my DB: "Beschermt DVD’s, CD’s, foto’s, CD-roms en...".
This seems to be okay; I can get the value back from the DB and display it the same way in a browser (set to prefer UTF-8).
However, in phpMyAdmin I see the description as: "Beschermt DVD’s, CD’s, foto’s, CD-roms en..."
Collation is set to utf8_unicode_ci on the connection (global config), column, table and database.
The character encoding is set to UTF-8 Unicode (utf8).
I'm running phpMyAdmin v2.11.1 and MySQL 5.0.45 on a Windows system
In config.inc.php for phpMyAdmin I see the following is defined:
My my.cnf file for MySQL contains:
Does anyone know what's going on here? Why is phpMyAdmin screwing up the characters?
Code: Select all
mb_language('uni');
mb_http_output("UTF-8");
mb_internal_encoding("UTF-8");
header("Cache-control: private");
header("Content-type: text/html; charset=utf-8");This seems to be okay; I can get the value back from the DB and display it the same way in a browser (set to prefer UTF-8).
However, in phpMyAdmin I see the description as: "Beschermt DVD’s, CD’s, foto’s, CD-roms en..."
Collation is set to utf8_unicode_ci on the connection (global config), column, table and database.
The character encoding is set to UTF-8 Unicode (utf8).
I'm running phpMyAdmin v2.11.1 and MySQL 5.0.45 on a Windows system
In config.inc.php for phpMyAdmin I see the following is defined:
Code: Select all
// Default language to use, if not browser-defined or user-defined
$cfg['DefaultLang'] = 'en-iso-8859-1';
// Default connection collation (used for MySQL >= 4.1)
$cfg['DefaultConnectionCollation'] = 'utf8_unicode_ci';
// Default charset to use for recoding of MySQL queries, does not take
// any effect when charsets recoding is switched off by
// $cfg['AllowAnywhereRecoding'] or in language file
// (see $cfg['AvailableCharsets'] to possible choices, you can add your own)
$cfg['DefaultCharset'] = 'utf-8';
// Available charsets for MySQL conversion. currently contains all which could
// be found in lang/* files and few more.
// Charsets will be shown in same order as here listed, so if you frequently
// use some of these move them to the top.
$cfg['AvailableCharsets'] = array(
'utf-16',
'utf-8',
);Code: Select all
character-set-server = utf8
collation-server = utf8_unicode_ci