Amp\Mysql\ConnectionPool::setCharset PHP Method

setCharset() public method

First parameter may be collation too, then charset is determined by the prefix of collation
public setCharset ( $charset, $collate = "" )
    public function setCharset($charset, $collate = "")
    {
        if ($collate === "" && false !== ($off = strpos($charset, "_"))) {
            $collate = $charset;
            $charset = substr($collate, 0, $off);
        }
        $this->ready = [];
        $this->config->charset = $charset;
        $this->config->collate = $collate;
        foreach ($this->connections as $conn) {
            if ($conn->alive()) {
                $conn->setCharset($charset, $collate);
            }
        }
    }