Is db in unicode mode?
@return bool
546995
public function setup_is_unicodedb() {
        // Get PostgreSQL server_encoding value
        $sql = "SHOW server_encoding";
        $this->query_start($sql, null, SQL_QUERY_AUX);
        $result = pg_query($this->pgsql, $sql);
        $this->query_end($result);

        if (!$result) {
            return false;
        }
        $rawcolumn = pg_fetch_object($result);
        $encoding = $rawcolumn->server_encoding;
        pg_free_result($result);

        return (strtoupper($encoding) == 'UNICODE' || strtoupper($encoding) == 'UTF8');
    }
347658
function GetCharSet()
	{
		//we will use ADO's builtin property charSet
		$this->charSet = @pg_client_encoding($this->_connectionID);
		if (!$this->charSet) {
			return false;
		} else {
			return $this->charSet;
		}
	}
1258635
public function hasDataInPostsType()
    {
        $postTypes = PostType::all();
        foreach($postTypes as $postType){
            $hasData = DB::table($postType->slug)->where("createdByUserID", $this->userID)->count();
            if($hasData) {
                return true;
            }

            foreach($postType->fields as $field){
                if($field->type->inputType == "db" && $field->dbTable->name == "users") {
                    if($field->translatable) {
                        if($field->isMultiple) {
                            foreach(Language::all() as $language){
                                $hasData = DB::table("post_articles")->whereRaw("JSON_CONTAINS($field->slug->\"$.$language->slug\", '[$this->userID]')")->count();
                                if($hasData) { return true;
                                }
                            }
                        }else{
                            foreach(Language::all() as $language){
                                $hasData = DB::table($postType->slug)->where($field->slug."->".$language->slug, $this->userID)->count();
                                if($hasData) { return true;
                                }
                            }
                        }
                    }else{
                        if($field->isMultiple) {
                            $hasData = DB::table($postType->slug)->whereRaw("JSON_CONTAINS($field->slug, '[$this->userID]')")->count();
                            if($hasData) { return true;
                            }
                        }else{
                            $hasData = DB::table($postType->slug)->where($field->slug, $this->userID)->count();
                            if($hasData) { return true;
                            }
                        }
                    }
                }

            }

        }
        return false;
    }
670092
public function getDefaultCharacterSet()
    {
        $characterSet = $this->config->get('database.preferred_character_set');
        $characterSet = $this->normalizeCharacterSet($characterSet);

        return $characterSet;
    }
1133765
public function isSupported()
    {
        $result = true;
        $table  = $this->getMixer();

        //Only check if we are connected with a table object, otherwise just return true.
        if($table instanceof DatabaseTableInterface)
        {
            if($table->hasColumn('slug'))
            {
                //If unique is NULL use the column metadata
                if(is_null($this->_unique)) {
                    $this->_unique = $table->getColumn('slug', true)->unique;
                }
            }
            else $result = false;
        }

        return $result;
    }
909712
public function isBoolean()
    {
        $columnType = $this->getColumnType();

        if (
            DatatypeConverterInterface::USERDATATYPE_BOOL == $columnType ||
            DatatypeConverterInterface::USERDATATYPE_BOOLEAN == $columnType ||
            (
                DatatypeConverterInterface::DATATYPE_TINYINT == $columnType &&
                preg_match('/^(is|has|can)_/', $this->getColumnName())
            )
        ) {
            return true;
        }

        return false;
    }
915111
public static function isMBString(): bool
    {
        static $isLoaded;

        if (null === $isLoaded) {
            $isLoaded = extension_loaded('mbstring');

            if ($isLoaded) {
                mb_internal_encoding(self::$encoding);
            }
        }

        return $isLoaded;
    }
172415
def _CheckDatabaseEncoding(cursor):
  """"""
  cur_character_set = _ReadVariable("character_set_database", cursor)
  if cur_character_set != CHARACTER_SET:
    raise EncodingEnforcementError(
        "Require MySQL character_set_database of {}, got {}."
        " To create your database, use: {}".format(CHARACTER_SET,
                                                   cur_character_set,
                                                   CREATE_DATABASE_QUERY))
1164341
public function isText()
    {
        return in_array($this->type, [
            PropelTypes::VARCHAR,
            PropelTypes::LONGVARCHAR,
            PropelTypes::CHAR,
        ]);
    }
991433
private function isTable(){
        try {
            if($table = $this->GetTable()){
                $sql = 'SHOW COLUMNS FROM '.$table;
                return $res = $this->query($sql)->all();
            }
        }catch(\Exception $e){
            echo $e->getMessage();
        }
        return false;
    }
255755
protected function _validateInput()
    {
        $result = true;

        $oxid = $this->getEditObjectId();
        $parameters = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");

        // if creating new language, checking if language already exists with
        // entered language abbreviation
        if (($oxid == -1) && $this->_checkLangExists($parameters['abbr'])) {
            $this->addDisplayException('LANGUAGE_ALREADYEXISTS_ERROR');
            $result = false;
        }

        // As the abbreviation is used in database view creation, check for allowed characters
        if (!$this->checkAbbreviationAllowedCharacters($parameters['abbr'])) {
            $this->addDisplayException('LANGUAGE_ABBREVIATION_INVALID_ERROR');
            $result = false;
        }

        // checking if language name is not empty
        if (empty($parameters['desc'])) {
            $this->addDisplayException('LANGUAGE_EMPTYLANGUAGENAME_ERROR');
            $result = false;
        }

        return $result;
    }
489216
public function validateDb()
    {
        $existing = $this->db->query('SHOW TABLES')->fetchColumn();

        if (empty($existing)) {
            return true;
        }

        return $this->translation->text('The database you specified already has tables');
    }
172484
private function _isCompressed()
    {
        if (is_dir($this->bag)) {
            return false;
        } else {
            $bag = strtolower($this->bag);
            if (endsWith($bag, '.zip')) {
                $this->bagCompression = 'zip';
                return true;
            } else if (endsWith($bag, '.tar.gz') || endsWith($bag, '.tgz')) {
                $this->bagCompression = 'tgz';
                return true;
            }
        }
        return false;
    }
517917
function ReadChar()
    {
        if ($this->IsAtEnd())
            return false;
        
        $ch = $this->string{$this->idx};
        ++$this->idx;
        if ($ch >= $this->utf8Start && !$this->IsAtEnd())
        {
            $ch .= $this->string{$this->idx};
            ++$this->idx;
        }
        return $ch;
    }
1120701
function isUTF8()
    {
        $string = (string) $this;
        if (function_exists('utf8_decode'))
            $decodedStr = strlen(utf8_decode($string));
        elseif (function_exists('mb_convert_encoding'))
            $decodedStr = strlen(utf8_decode($string));
        else
            $decodedStr = $string;


        return strlen($string) != strlen($decodedStr);
    }
816835
private function areNullableReturnTypesSupported(): bool
    {
        $testVersion = trim(PHPCompatibility\PHPCSHelper::getConfigData('testVersion') ?: '');
        if (!$testVersion) {
            return false;
        }

        preg_match('`^(\d+\.\d+)(?:\s*-\s*(?:\d+\.\d+)?)?$`', $testVersion, $matches);
        $min = $matches[1] ?? null;

        return $min && version_compare($min, '7.1', '>=');
    }
95578
protected function isRegexpLiteral()
    {
        if (strpos("\n{;(,=:[!&|?", $this->a) !== false) {
            return true;
        }
        if ($this->a === ' ') {
            $length = strlen($this->output);
            if ($length < 2) {
                return true;
            }
            if (preg_match('/(?:case|else|in|return|typeof)$/', $this->output, $m)) {
                if ($this->output === $m[0]) {
                    return true;
                }
                $charBeforeKeyword = substr($this->output, $length - strlen($m[0]) - 1, 1);
                if (!$this->isAlphaNum($charBeforeKeyword)) {
                    return true;
                }
            }
        }
        return false;
    }