Welcome Guest, Not a member yet? Register   Sign In
$config['charset']
#1

[eluser]cdmn[/eluser]
As we all know, CI v. 1.5.4 has a config value: $config['charset'] which is used in some string handling functions.

I would like to ask if this config value affects SET NAMES '{$config['charset']}'?

And are there any support for SET NAMES?
#2

[eluser]Référencement Google[/eluser]
It looks like not, I myself added a line in /system/database/DB.php at line 83 changed for:

Code:
$DB->query("SET NAMES 'utf8'");
return $DB;

Note that I blocked to UTF-8 since I use only this, it would be more smart to take the $config[’charset’] but I am too lazy to try doing it ;-)
#3

[eluser]cdmn[/eluser]
Lets hope next release will have something like this :-)

Thanks for your tip.
#4

[eluser]kylehase[/eluser]
[quote author="elitemedia" date="1191011815"]
Code:
$DB->query("SET NAMES 'utf8'");
return $DB;
[/quote]
FYI, this solution worked but produced an error in my log file.

Severity: Warning --> mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given /var/www/html/adminui/system/database/drivers/mysqli/mysqli_result.php 37

I'm now using the dummy library discussed here:http://ellislab.com/forums/viewthread/62139/
#5

[eluser]dyron[/eluser]
Hi,

my solution for this problem is to extend the database config file:

Code:
$db['default']['charset']  = "UTF8";

Because it's different to:

Code:
$config['charset'] = "utf-8";

And I also add

Code:
// Setting the charset        
    $DB->query("SET NAMES ?", $params['charset']);

to the "/system/database/DB.php" file. So it's not static UTF8.
#6

[eluser]czarft[/eluser]
Thank you.
I has include little condition.
Code:
if ( $params['charset']!="" )
    {
        $DB->query("SET NAMES ?", $params['charset']);
    }




Theme © iAndrew 2016 - Forum software by © MyBB