function Tasks::checkEncoding
Check encoding is UTF8.
File
- 
              core/
modules/ pgsql/ src/ Driver/ Database/ pgsql/ Install/ Tasks.php, line 131  
Class
- Tasks
 - Specifies installation tasks for PostgreSQL databases.
 
Namespace
Drupal\pgsql\Driver\Database\pgsql\InstallCode
protected function checkEncoding() {
  try {
    if (Database::getConnection()->query('SHOW server_encoding')
      ->fetchField() == 'UTF8') {
      $this->pass($this->t('Database is encoded in UTF-8'));
    }
    else {
      $this->fail($this->t('The %driver database must use %encoding encoding to work with Drupal. Recreate the database with %encoding encoding. See <a href="INSTALL.pgsql.txt">INSTALL.pgsql.txt</a> for more details.', [
        '%encoding' => 'UTF8',
        '%driver' => $this->name(),
      ]));
    }
  } catch (\Exception) {
    $this->fail($this->t('Drupal could not determine the encoding of the database was set to UTF-8'));
  }
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.