concrete/src/Database/CharacterSetCollation/Resolver.php
public function resolveCharacterSetAndCollation(Connection $connection)
    {
        $characterSet = $this->getCharacterSet();
        $collation = $this->getCollation();
        if ($collation !== '') {
            $collations = $connection->getSupportedCollations();
            if (!isset($collations[$collation])) {
                throw new Exception\UnsupportedCollationException($collation);
            }
            if ($characterSet === '') {
                $characterSet = $collations[$collation];
            } elseif ($characterSet !== $collations[$collation]) {
                throw new Exception\InvalidCharacterSetCollationCombination($characterSet, $collation, $collations[$characterSet]);
            }
        } elseif ($characterSet !== '') {
            $characterSets = $connection->getSupportedCharsets();
            if (!isset($characterSets[$characterSet])) {
                throw new Exception\UnsupportedCharacterSetException($characterSet);
            }
            $collation = $characterSets[$characterSet];
        } else {
            throw new Exception\NoCharacterSetCollationDefinedException();
        }
        if (!$connection->isCollationSupportedForKeys($collation, $this->getMaximumStringKeyLength())) {
            throw new Exception\LongKeysUnsupportedByCollation($collation, $this->getMaximumStringKeyLength());
        }

        return [$characterSet, $collation];
    }
public function resolveCharacterSetAndCollation(Connection $connection)
    {
        $characterSet = $this->getCharacterSet();
        $collation = $this->getCollation();
        if ($collation !== '') {
            $collations = $connection->getSupportedCollations();
            if (!isset($collations[$collation])) {
                throw new Exception\UnsupportedCollationException($collation);
            }
            if ($characterSet === '') {
                $characterSet = $collations[$collation];
            } elseif ($characterSet !== $collations[$collation]) {
                throw new Exception\InvalidCharacterSetCollationCombination($characterSet, $collation, $collations[$characterSet]);
            }
        } elseif ($characterSet !== '') {
            $characterSets = $connection->getSupportedCharsets();
            if (!isset($characterSets[$characterSet])) {
                throw new Exception\UnsupportedCharacterSetException($characterSet);
            }
            $collation = $characterSets[$characterSet];
        } else {
            throw new Exception\NoCharacterSetCollationDefinedException();
        }
        if (!$connection->isCollationSupportedForKeys($collation, $this->getMaximumStringKeyLength())) {
            throw new Exception\LongKeysUnsupportedByCollation($collation, $this->getMaximumStringKeyLength());
        }

        return [$characterSet, $collation];
    }
public function resolveCharacterSetAndCollation ( Connection $ connection ) { $ characterSet = $ this -> getCharacterSet ( ) ; $ collation = $ this -> getCollation ( ) ; if ( $ collation !== '' ) { $ collations = $ connection -> getSupportedCollations ( ) ; if ( ! isset ( $ collations [ $ collation ] ) ) { throw new Exception \ UnsupportedCollationException ( $ collation ) ; } if ( $ characterSet === '' ) { $ characterSet = $ collations [ $ collation ] ; } elseif ( $ characterSet !== $ collations [ $ collation ] ) { throw new Exception \ InvalidCharacterSetCollationCombination ( $ characterSet , $ collation , $ collations [ $ characterSet ] ) ; } } elseif ( $ characterSet !== '' ) { $ characterSets = $ connection -> getSupportedCharsets ( ) ; if ( ! isset ( $ characterSets [ $ characterSet ] ) ) { throw new Exception \ UnsupportedCharacterSetException ( $ characterSet ) ; } $ collation = $ characterSets [ $ characterSet ] ; } else { throw new Exception \ NoCharacterSetCollationDefinedException ( ) ; } if ( ! $ connection -> isCollationSupportedForKeys ( $ collation , $ this -> getMaximumStringKeyLength ( ) ) ) { throw new Exception \ LongKeysUnsupportedByCollation ( $ collation , $ this -> getMaximumStringKeyLength ( ) ) ; } return [ $ characterSet , $ collation ] ; }
Resolve the character set and collation.

@param \Concrete\Core\Database\Connection\Connection $connection

@throws \Concrete\Core\Database\CharacterSetCollation\Exception\NoCharacterSetCollationDefinedException
@throws \Concrete\Core\Database\CharacterSetCollation\Exception\UnsupportedCharacterSetException
@throws \Concrete\Core\Database\CharacterSetCollation\Exception\UnsupportedCollationException
@throws \Concrete\Core\Database\CharacterSetCollation\Exception\InvalidCharacterSetCollationCombination
@throws \Concrete\Core\Database\CharacterSetCollation\Exception\LongKeysUnsupportedByCollation

return string[] first value is the character set; the second value is the collation
Resolve the character set and collation .