Welcome Guest, Not a member yet? Register   Sign In
DB charset/collation problem
#3

[eluser]serans1[/eluser]
Nailed down.
CI perform the following query :
SET NAMES 'utf8' COLLATE 'utf8_general_ci'
System collation & charset before the query are :
Array ( [Variable_name] => character_set_client [Value] => latin1 ) Array ( [Variable_name] => character_set_connection [Value] => latin1 ) Array ( [Variable_name] => character_set_database [Value] => utf8 ) Array ( [Variable_name] => character_set_filesystem [Value] => binary ) Array ( [Variable_name] => character_set_results [Value] => latin1 ) Array ( [Variable_name] => character_set_server [Value] => latin1 ) Array ( [Variable_name] => character_set_system [Value] => utf8 ) Array ( [Variable_name] => character_sets_dir [Value] => /usr/share/mysql/charsets/ )

Array ( [Variable_name] => collation_connection [Value] => latin1_swedish_ci ) Array ( [Variable_name] => collation_database [Value] => utf8_unicode_ci ) Array ( [Variable_name] => collation_server [Value] => latin1_swedish_ci )

and after :
Array ( [Variable_name] => character_set_client [Value] => utf8 ) Array ( [Variable_name] => character_set_connection [Value] => utf8 ) Array ( [Variable_name] => character_set_database [Value] => utf8 ) Array ( [Variable_name] => character_set_filesystem [Value] => binary ) Array ( [Variable_name] => character_set_results [Value] => utf8 ) Array ( [Variable_name] => character_set_server [Value] => latin1 ) Array ( [Variable_name] => character_set_system [Value] => utf8 ) Array ( [Variable_name] => character_sets_dir [Value] => /usr/share/mysql/charsets/ )

Array ( [Variable_name] => collation_connection [Value] => utf8_general_ci ) Array ( [Variable_name] => collation_database [Value] => utf8_unicode_ci ) Array ( [Variable_name] => collation_server [Value] => latin1_swedish_ci )

summary
CI sets the encoding and names by default and if you migrating to CI and have two pieces of codes one works with CI and the other w/o then you need to make sure that names and charsets are matching - it will not use the default as stated in the db settings.
to view your db(mysql) settings you can query:
SHOW VARIABLES LIKE 'character_set%';
SHOW VARIABLES LIKE 'collation%';


Messages In This Thread
DB charset/collation problem - by El Forum - 05-07-2009, 08:51 AM
DB charset/collation problem - by El Forum - 05-07-2009, 09:23 AM
DB charset/collation problem - by El Forum - 05-07-2009, 12:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB