public function set_charset($charset = 'utf8', $collation = 'utf8_general_ci') {

        // do not show the warning that this method has not been called
        unset($this->warnings['charset']);

        // set MySQL character set
        $this->query('SET NAMES "' . $this->escape($charset) . '" COLLATE "' . $this->escape($collation) . '"');

    }
public function set_charset($charset = 'utf8', $collation = 'utf8_general_ci') {

        // do not show the warning that this method has not been called
        unset($this->warnings['charset']);

        // set MySQL character set
        $this->query('SET NAMES "' . $this->escape($charset) . '" COLLATE "' . $this->escape($collation) . '"');

    }
public function set_charset ( $ charset = 'utf8' , $ collation = 'utf8_general_ci' ) { // do not show the warning that this method has not been called unset ( $ this -> warnings [ 'charset' ] ) ; // set MySQL character set $ this -> query ( 'SET NAMES "' . $ this -> escape ( $ charset ) . '" COLLATE "' . $ this -> escape ( $ collation ) . '"' ) ; }
Sets MySQL character set and collation.

The ensure that data is both properly saved and retrieved from the database you should call this method first
thing after connecting to the database.

If this method is not called a warning message will be displayed in the debugging console.

Warnings can be disabled by setting the {@link disable_warnings} property.

@param  string  $charset    (Optional) The character set to be used by the database.

Default is 'utf8'.

See the {@link http://dev.mysql.com/doc/refman/5.1/en/charset-charsets.html list of possible values}

@param  string  $collation  (Optional) The collation to be used by the database.

Default is 'utf8_general_ci'.

See the {@link http://dev.mysql.com/doc/refman/5.1/en/charset-charsets.html list of possible values}

@since  2.0

@return void
Sets MySQL character set and collation .