Article: Turning MySQL data in latin1 to utf8 utf-8
http://www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html
-----
If using UTF8 in general, 2 queries must follow the db connection:
mysql_query('SET NAMES UTF8');
mysql_query('SET COLLATION_CONNECTION=UTF8_GENERAL_CI');
Check the class file's execute() function for the following. Amend as necessary.
// [database connection made above]
// UTF8 setting
if(!@mysql_query('SET NAMES UTF8')){ error(mysql_error()); }
if(!@mysql_query('SET COLLATION_CONNECTION=UTF8_GENERAL_CI')){ error(mysql_error()); }
// ISO-8859-2 setting
// if(!@mysql_query('SET NAMES LATIN2')){ error(mysql_error()); }
// if(!@mysql_query('SET COLLATION_CONNECTION=LATIN2_GENERAL_CI')){ error(mysql_error()); }
// WINDOWS-1250 connection
// if(!@mysql_query('SET NAMES CP1250')){ error(mysql_error()); }
// if(!@mysql_query('SET COLLATION_CONNECTION=CP1250_GENERAL_CI')){ error(mysql_error()); }
If using UTF8, HTML files need to include 2 META tags:
Consider setting a language tag:
Consider setting the following tags as well:
Clear your web browser cache if problems persist with correctly displaying accented characters.
-----
Users may need to apply utf8_encode() to values in language files which contain accented characters.
-----
17 Jan 2009 - notes
I noticed in the Forum someone appending -UTF8 to the $_SERVER['HTTP_ACCEPT_LANGUAGE']
Not sure if this works, or is advisable, need to research it's usage.
$opts['language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'] . '-UTF8';