public function set_charset($charset)
	{
		// Make sure the database is connected
		$this->_connection or $this->connect();

		// Set Charset for SQL Server connection
		if (strtolower($this->driver_name()) == 'sqlsrv')
		{
			$this->_connection->setAttribute(\PDO::SQLSRV_ATTR_ENCODING, \PDO::SQLSRV_ENCODING_SYSTEM);
		}
		// Set Charset for SQLite connection
		elseif (strtolower($this->driver_name()) == 'sqlite')
		{
			// Execute a raw PRAGMA encoding query
			$this->_connection->exec('PRAGMA encoding = ' . $this->quote($charset));
		}
		// Set Charset for any connection except ODBC, as it throws exception
		elseif (strtolower($this->driver_name()) != 'odbc')
		{
			// Execute a raw SET NAMES query
			$this->_connection->exec('SET NAMES '.$this->quote($charset));
		}
	}
public function set_charset($charset)
	{
		// Make sure the database is connected
		$this->_connection or $this->connect();

		// Set Charset for SQL Server connection
		if (strtolower($this->driver_name()) == 'sqlsrv')
		{
			$this->_connection->setAttribute(\PDO::SQLSRV_ATTR_ENCODING, \PDO::SQLSRV_ENCODING_SYSTEM);
		}
		// Set Charset for SQLite connection
		elseif (strtolower($this->driver_name()) == 'sqlite')
		{
			// Execute a raw PRAGMA encoding query
			$this->_connection->exec('PRAGMA encoding = ' . $this->quote($charset));
		}
		// Set Charset for any connection except ODBC, as it throws exception
		elseif (strtolower($this->driver_name()) != 'odbc')
		{
			// Execute a raw SET NAMES query
			$this->_connection->exec('SET NAMES '.$this->quote($charset));
		}
	}
public function set_charset ( $ charset ) { // Make sure the database is connected $ this -> _connection or $ this -> connect ( ) ; // Set Charset for SQL Server connection if ( strtolower ( $ this -> driver_name ( ) ) == 'sqlsrv' ) { $ this -> _connection -> setAttribute ( \ PDO :: SQLSRV_ATTR_ENCODING , \ PDO :: SQLSRV_ENCODING_SYSTEM ) ; } // Set Charset for SQLite connection elseif ( strtolower ( $ this -> driver_name ( ) ) == 'sqlite' ) { // Execute a raw PRAGMA encoding query $ this -> _connection -> exec ( 'PRAGMA encoding = ' . $ this -> quote ( $ charset ) ) ; } // Set Charset for any connection except ODBC, as it throws exception elseif ( strtolower ( $ this -> driver_name ( ) ) != 'odbc' ) { // Execute a raw SET NAMES query $ this -> _connection -> exec ( 'SET NAMES ' . $ this -> quote ( $ charset ) ) ; } }
Set the charset

@param string $charset
Set the charset